Numerous evolutionist theoreticians have noted that the presence of gay people in a culture is fairly consistent throughout history indicating it must play some beneficial evolutionary role. If it didn't they noted what conservative anti-gay groups have claimed,"it would die out."
But it doesn't die out which calls the conservative theory into question. They posit a theory that gay individuals tend to help further the survival of "near kin" that is, they help further the lives of their wider family. Thus we often saw gay people being the extra hand for parents in their old age, or caregivers to nieces and nephews. That while their existence didn't necessarily spread their genes, it did help spread the genes of people with substantial genetic overlap.
I have no firm view on that theory myself as I know far too little to express an opinion. I do think, based on knowing hundreds of gay people over the years, that it is a genetic component at play and it is most certainly isn't simple "a lifestyle choice." There is little "choice" in sexual orientation at all.
That confuses a lot of people because some aspect of sexuality are very much choice but other more fundamental issues are completely outside the realm of choice. You have little to no control over which individuals you find sexually attractive, but do have control over how you express that desire.
I’d add that the ubiquity of same-sex attraction across cultures and ethnicities weighs in favor of a physiological explanation of some kind as opposed to a cultural one. Research shows that having more older brothers correlates with being gay, for example.
But anyway, a culture just about always has a few gay people, and that eliminates a lot of potential explanations.
I tend to look at all this as a series of switches which are present female gender as all of us start out. So the switch for body is set female. Sexual attractions are set for male. Gender identity is set for female. Then the fetus gets the hormones necessary to develop as male, and the switch is normally set for a male gender identity and an attraction now to females.
But sometimes the switches don't all switch so a male with a male gender identity is still attracted to males. Or sometimes they switch on their own but not in sync. So we have people with bodies that don't match gender identity. Yet many trans women are attracted to women after they transition. There are a number of possible combinations on those switches and it results in sexual diversity. But all those switches are ones we can't flip on our own or through therapy or prayer.