The survival of a human predisposition for homosexuality can be explained by sexual orientation being a polygenetic trait that is influenced by a number of genes. During development these shift male brain development in the female direction. Inheritance of several such alleles produces homosexuality. Single alleles make for greater sensitivity, empathy, tendermindedness, and kindness. These traits make heterosexual carriers of the genes better fathers and more attractive mates. There is a balanced polymorphism in which the feminizing effect of these alleles in heterosexuals offsets the adverse effects (on reproductive success) of these alleles contribution to homosexuality. A similar effect probably occurs for genes that can produce lesbianism in females. The whole system survives because it serves to provide a high degree of variability among the personalities of offspring, providing the genotype with diversification, and reducing competition among offspring for the same niches. An allele with a large effect can survive in these circumstances in males, but it is less likely to survive in females. The birth order effect on homosexuality is probably a byproduct of a biological mechanism that shifts personalities more in the feminine direction in the later born sons, reducing the probability of these sons engaging in unproductive competition with each other.
Miller, Edward M., "Homosexuality, birth order, and evolution: towards a equilibrium reproductive economics of homosexuality;" (1999). Department of Economics and Finance Working Papers, 1991-2006. Paper 19.