If you have read the guardian article regarding evolution new theories and genetics you will get my point : even genetics are influenced by environment.
Regarding the rare animal homosexuality, its also an environmental issue, where power, dominance, complexed social structure, scarce occasion...