I often get asked if homosexuality is a matter of choice or is it due to nature. It's not always clear what the asker means by nature, but usually they have in their minds something akin to how skin color is largely determined by certain combinations of genes. If homosexuality is controlled in the same sort of way then, the reasoning goes, we should not discriminate against people because of their sexual orientation.
Yet this sort of reasoning and the supposed dichotomy between nature and nurture is a case of correct conclusion but the wrong argument: kind of like chiropractic which may have come up with some good treatments for certain joint and bone problems but from a faulty premise about the cause of disease. Recently though researchers have begun to look more closely at the interaction between genetics and environment in determining certain aspects of human behavior, not specifically homosexuality but I think these studies do have something to say about how we view human behavior in general.
Some of this research is discussed in SCIAM Observations in an article "Can nurture save you from your own genes?" by Charles Glatt. Dr. Glatt reviews a study that considers individuals with genetic variants of a series of genes known to be linked to depression, but who have been raised in different environments. In a nut shell, children with certain combinations of these genes were more likely to develop depression than children lacking these gene combinations if the children were raised in an environment where they were abused.
Nurturing environments where children received support could trump the affects of genetics. The point from my end isn't that the same exact thing happens in homosexuality but that genes and environment interact and indeed genes may or may not be involved in a particular individual's case. After all in this study, depression scores were higher for kids in non nurturing environments even if genes conferring susceptibility to depression were absent. So the environment alone was sufficient to cause depression.
Glatt says something interesting at the end of his article namely that these results will "come as a relief to believers in human free will." But free will in the context of behavior can be reduced by environment and nurture as well as by genetics. As E.O. Wilson once said when he was accused of genetic determinism, that if everything is due to environment then hat amounts to environmental determinism. Free will is internal and comes about from how all the influences on our development genes and environment interact with our developing mind which is always calculating and shaping our trajectory through life and that includes various aspects of our identity.
So yes, don't discriminate against someone because of sexual identity or gender identification not because these are innate but because they are expressions of free will, something that ought to be valued in a society based on the concept of inalienable rights. The model for gay rights and transgender rights from my way of thinking is more akin to why we grant religious liberty rather than analogy with race. Free will exists but it is constrained by history be it genetic, developmental or nurture and experience in very subtle ways.