Gender in humans has been something pretty skewed by ideology that we have lost sight of the most important aspects of life. Everyone from street people to medical doctors still insist they know better than everyone else. The reality is that we really don't know.
The first life forms on the planet, the ones we got our genetic start from, are all capable of asexual reproduction, they did not need to have any form of physical attraction for each other. But does that mean they had no genders or sexuality? Well, no, these early organisms likely had the same variations in gender and sexuality we see in the more complex life forms today, they just didn't need them, and had no brains to act on the genetically determined attractions.
As life forms became more complex, colonies of these earlier life forms evolving to work with other colonies, we call these "organs" now, genetic material needed more variation to keep the organisms alive. Enter sexual reproduction, as an option. The earliest life forms didn't need to reproduce sexually, they didn't require the sharing of genetic material, it was an option though. The life forms that did utilize this option, however, became more common, their populations grew faster and they adapted better to their environments.
Essentially, natural selection had more traits to select from because of the organisms that were mixing their genetic material with similar organisms, resulting in more variation, more life, and more chances for survival. This eventually produced more stable methods of reproduction, bisexual and orgy style methods being the most suitable for producing stable, and capable, offspring.
But life is like a weed in a garden, once it starts, there's almost no way to stop it. So organisms spread through the planet, covering it's surface completely. Plant life terraformed the planet so that other life forms could crawl on the dry portions as well. Life was booming, and the only real threat to life was other life. So the original methods of reproduction were no longer necessary, they actually had a drawback in that many species were quickly overpopulating portions of the planet. When plants do, they create too much oxygen and the atmosphere itself can become explosive as a result.
This eventually produced a collection of species that reproduced in a less efficient method, mono-sexual. A dichotomous gender system, one male, one female. This system slowed their growth, allowing the resources to be more easily divided among them, increasing their fitness within the world. But these species came from those who had other methods of reproduction, and thus the genetic material needed to drive reproduction included those of various other methods as well. This proves to be a huge benefit, because it slowed down the reproductive rates even more, allowing even more resources to be available for any individual of a species.
Fast forward to today, skipping the Triassic and other eras, and you now have modern species, humans being one of them. At first humanity embraced our primitive natures, even today we are very primitive actually. This prevented us from over populating our environment, allowing the resources to be more plentiful for each individual is what helped to make us a strong species.
It was all moving along swimmingly for a while, several million years went by and our species was improving in ways no other species had managed to improve. We learned to not only utilize our environment, but how to change it, what we now call genetic modification. Our methods were sloppy at first, but we were so very young then. But our population growth was not excessive, it was "just right" for our species, because not everyone was breeding, and people were dying at very young ages.
Then the worse thing could happen, people decided they didn't want to be animals anymore, which was not going to magically change us into something else. So they found ways to enforce this dichotomous gender system, using social engineering, we call it religion now. This caused more people to reproduce, more people to breed, and our population began exploding. Our only saving grace was that illness claimed more of us when our populations reached critical levels.
Then we figured out how to keep ourselves alive much longer, medicine, clean water, and other advances. We lost control of our population completely, yet people still hold onto this idea, the one idea that started this mess in the first place, that everyone should breed. This has not only created some serious social problems, psychological problems in children, and over all insanity in the general population .... it has ultimately caused us to become our own biggest threat.
Luckily, we are still intelligent, somewhat, enough to realize that these problems hurt each other socially and psychologically. So we are making strides in correcting the presumption that humans only exist to breed, however, most will still deny the bigger threat to our species. Over population of any species is a bad thing, not because it will stamp out other life forms, those will evolve into better life forms as a result, actually. It's a threat to our species because the resources for each individual will be reduced to a level that requires us to kill each other more than we do already.
We have worked for peace in our species, trying to end all wars, yet right now war is the most humane method of keeping our population in check. I would rather us be able to afford peace in the world, than to see the gender system remain a dichotomy just because of some ignorant humans who cannot mature beyond childish superstitions.