Ranma married Akane, but because of the "special wedding sake" that
Colonge gave as a present, she couldn't give birth. Shampoo found a
cure, but it allowed Akane only to have all girls. Ranma unaware of
Akane's problem, wanted to have a boy, even though Akane knew she could
have only girls (makes you wonder why she didn't tell him)
So Akane persaded Ukyou to cut her hair like her's, and they tricked
Ranma into thinking Ukyou was Akane (he was drunk at the time), he
fathered Ukyou's child (Akane did this because she knew how badly Ranma
wanted a boy and wanted the best for him). Shampoo found out, and wanted
Ranma to father a child for her even though she was married to Mousse (I
guess she never really gave up on him (^_^).