My view is that there is probably a genetic reason for why some people prefer gay sex, or people of the same gender. First is that people generally find people of the opposite sex attractive. Furthering that healthy, young people with well proportioned features are usually considered attractive. Now the brain is hard wired to this. So perhaps the wiring for this can get mixed up and the person has one gene slightly wrong so their brain wires slightly different and they are more likely to become gay. Of course like with anything regarding the mind there are infinite ways each person can turn out with that.
Of course there will also be those that be gay to experience it and not for any subconscious reason.