For the act, see: sex.
It is not obvious why there have to be two sexes.
Sex itself is obvious: by mixing genes we increase variability.
But having two sexes rather than just being able to reproduce with anyone reduces the possible mating pool by half!
One of the key thesis of Power, Sex, Suicide by Nick Lane (2006).
Also mentioned at:
Analects translation by Robert Eno (2015) 16.7:
The Junzi has three cautions.
A signal that indicates that an animal is ready for mating.
Ciro Santilli is for abortion rights of women, until very late in pregnancy.
But it's not something that he would do himself, unless under extreme cases.