Homosexuality is useful to evolution because it gives a society extra people to allocate where they're needed.
Societies compete against each other, just like individuals do. If Group A over here has all straight people, we can assume said straight people are mostly reproducing and spending their effort on their own children. Group B has some homosexuals, who don't reproduce (nearly as often), and that group has fewer children, but they also have those homosexuals to do things like helping take care of someone else's children (most likely their siblings'), gathering food, defending the group, building shelter, or making new discoveries; or freeing up heterosexuals to do those things. The children of the heterosexuals in that group, who carry recessive genetics for homosexuality, grow up, and some of them turn out to be homosexual.
In times of plenty and safety, the heterosexual group will be just fine. Their many children will grow up and have more little heterosexual children. That's an advantage because more children means more genes spread around; but only as long as the good times last.
In times of famine or war or with dangerous predators around, though, the group with homosexuals in it will start to do better. They're spending more effort on fewer children, so that each particular child has a better chance of surviving to adulthood; while the heterosexuals are trying to cope with too many children that they most likely can't feed in the first place, and ending up with only a few, weaker, adults in the next generation. They no longer have an advantage over the group with homosexuals in it because the extra children they were having end up dying, and the rest don't get as much care. Effort spent on children who die before they reproduce is, as far as evolution is concerned, wasted effort; and the exclusively heterosexual group in a time of famine will waste a lot of effort that way.
Over time, the societies with homosexuals--but not too many homosexuals--start to become predominant. Many hands make light work--and healthier children.
Edited by nerdgirl, 14 September 2009 - 10:00 AM.