Due to the discovery of epigenetics, the biological/environmental division has moved from "hazy" to "obliterated" in recent years. Sexuality probably has some degree of epigenetic factor involved in it, though ultimately we just don't know.
There is no "gay gene", that's definitely absurd. There probably isn't even a polygenetic gay factor. But of course, sexual conversion has objectively never produced anything but pure failure even if looked at without caring that it's an atrocity.
The example I liken this to is food preference. Different humans like different foods. This difference is fundamental and innate. We do not consciously control what foods we like, and though we can to a degree put dents in food preference you cannot make a food you hate into your favorite by forcing yourself to eat it nor does it seem very common that you can permanantly turn yourself off from a food that you love no matter how often you eat it.
Food preferences have definite foundational elements - fat, salt, and sugar are nearly-guaranteed winners. Yet specific foods containing these elements may be loved or hated. And sometimes people like foods that are totally arbitrary in this regard. The highest fat, salt, and sugar content doesn't always become a person's most favored foods.
You have a fuck engine in your brain that's operating off ancient scriptures of evolutionary success, layered over one another so thick that no one thing is easily read. Most people regardless of sexuality like looking at asses. But not everybody. A person can certainly choose to violate their instruction set - people going against their sexuality sometimes do get something out of it. But you can't change the fuck engine's actual operating parameters, not really.
And ultimately, humans regardless of sex and gender all look a lot more alike than anything else looks like us. People in the stone age appeared to have been able to... "appreciate" curvaceous sculptures, so these are the tolerances we're dealing with here. There's really no reason to even expect in the first place that it wouldn't fire off on other humans without appreciation of if it's a heterosexual paring or not. The really weird thing is not why some people are gay, but why anyone isn't bisexual.
The answer to that probably lies in the social thesis, sometimes called the "gay uncle hypothesis" - a certain mix of sexualities is evolutionarally advantageous, so it was long ago coded into socially advanced forms of life.