He had a fling with Kim even before he “officially” got with her. I can’t recall with whom she was at the time(Reggie?)but she was sleeping with Kanye at the same time.
At one point in his life, he was exclusively with men. But then he started to date women only publicly.
As far as being married with Kim, it was a win win for both of them.
It squashed the gay rumors, and Kim broke into the next level in fashion and more.
In addition, she gave him a family life that he craved at some level.
She knew exactly what she was getting into when she got with him.
Kris married a man who was about to transition, so the family is known for their accepting ways.