Yoko Ono's history is strange
She was committed to a mental ward by her first husband after giving birth to her daughter. (Later on he would disappear with said daughter and join a cult, the 60s were fun, those silly Japs). After getting out of the mental ward she would get married again right away. This marriage though I believe would be annulled as she was still technically married to her first husband.
No idea what happened with that relationship, but I suppose marrying a married woman would be embarrassing. Yoko then I believe found her way to the US where the good drugs were at. There John Lennon, a notorious prick mind you, ran into her at the height of his Cobain esque "can't handle the fame". With a severe case of yellow fever and she's got the good drugs he took her home and they-
However John was still married and his wife walked in on them in bed, Yoko wearing his wife's evening gown or whatever those are called. Well shit sir this is right awkward.
So goes on a messy divorce, didn't help that John was fairly abusive to his wife and son. But then again Yoko didn't really care about her kid (around this time said cult thing happened but there was no indication she even tried to track down her kid before her holiday).
Keep in mind George and Paul knew John since they were kids and knew their family. Awkward. Plus they had a no girlfriend distraction at work rule which John actively ignored because he had to have Yoko around all the time. John at the time was essentially out of it when it came to the Beatles but it didn't help that he brought in this bizarre woman who would be distracting and as Paul said "we'd come in and find her sitting on our amps". And again John had a temper problem and wasn't meshing with George in particular at the time so they just let it simmer.
Also keep in mind Yoko was almost ten years older than John at this point

But then sometime in the 70s Yoko wanted out so she had her 23 year old assistant bang John. It was ok, she was also a Yellow so she wasn't curing John of that. This affair lasted for 18 months which during that time John even reconciled with his first son. Yoko being a woman couldn't have some other woman fixing John so she came back
By all accounts at the end John mellowed out at least. Yoko has always been a disaster though.