Wish I could recall where I read this theory:
Creation began at the cellular level, and after a long period of time, cells began to divide into many. Eons passed and out of these many cells one gender life developed. Eons passed, more mutations occurred. The problem with a single sex is that recessive cells and less diversity within the population made them susceptible to illness and a shorter lifespan. Two gender mutation occurred, which led to more diversity among the population, which meant fewer issues with recessive genetics. Two gender life continued to thrive while single gender life began to die out.
Could it be that in our long ago genetic makeup we were the same sex and therefore attracted to the same sex? Could homosexuality be a throwback to a much earlier age and therefore still affects a small percentage of the human population?