Scientifically, it may just be an environmental reaction to any local under-population (**IF** you consider masturbation to be single-sex) or over-population event...say, sticking a straight man into a crowded prison filled only with men for 30 years.
Any kind of environmental factor is an ‘after-the-fact’ event that genetic programming does not anticipate. This seems to be the current rebuttal for the pro-gay and evolutionary crowd. Some tout the Gaia hypothesis as being the greater wisdom of the whole endorsing homosexual behavior as proper now that we are supposedly in environmental crisis.
I call B as in B and S as in S.
If this was a gene that is switched on due to environmental problems or population why have we not seen it in worse situations at times before? Of course, the rejoinder would be that society kept this in the closet and only now are we able to see the natural expression of nature's methods. Well, that would be fine and tidy except that it still would be nature's way of killing off population to bring things back into stasis.
I do believe that environment plays a factor but only to the extent that emotional and familial cues or actual events mold future behavior. The data I have seen indicates massive issues and trauma all across the spectrum of deviant sexuality. I do pity those trapped in what seems to be a predisposition but I do not buy that any more than I buy the disease theory of drug addiction. I believe it is a moral thing. Always has been and always will be.