In all probability the pre-historical human societies had close to 5 or 6 gender identities, keeping with the nature of humans. Indeed some of the surviving ancient tribes (e.g. the Native Americans or the Bugis of Sulawesi, etc.)). When there were not enough gender identities, unlike present day west, these cultures accommodated all the possible shades of gender within the ones available.
The feminine male, the masculine female and the hermaphrodite --- all were considered important members of the society and had their distinctive roles in the society. E.g. they often became priests and healers.
At some point of time Masculinity in men started to be valued much more --- perhaps because the society needed more warriors. This may have resulted in femininity in males being devalued.
This was the stage when boys had to now go through a 'manhood' test, testing their physical and mental stamina for a warrior/ hunter life, before they were taken in as men. Men and women used to live in separate groups and boys lived in women groups till they reached adolescence after which they either joined the men's group or the third gender group.
The feminine male gender which was originally a valued and respected gender now may also have become a kind of banishment for all those masculine gendered boys who could not pass the stringent, often cruel physical tests.
The various genders for the female sex were gradually abolished, but women were always allowed a lot of fluidity in all societies (except the Islamic and Christian ones later). Women could opt for both feminine and masculine roles within the same gender space. This was probably because femininity was not over valued in women. They could be warriors as well as housewives.
At some point of time the society manipulated masculine male gender and arbitrarily fixed 'procreation' as the new test of manhood --- clearly, to help augment the population. This automatically gave sex with women an immense