Yes, but traits that FAVOR survival tend to be promoted and passed forward.
There is little doubt that having a percentage of the population being gay helps the survival chances of the species. And not just ours, we see "gays" in several other species and it tends to have the same effect. But...