Firstly, you are asking a hypothetical question.
If it happens then we will discuss it.
Secondly, we know that people are not born homosexual but rather it is an impact the society and environment has upon a person.
Common sense will tell you that if someone hangs around with certain type of people then they are likely to become similar to those people, or at least adapt certain characteristics of those group of people.
For example, if one hangs around with drug addicts and accompanies them then that person is also likely to take drugs or even become an addict himself.
Let me ask you a counter-question.
If scientists find a gene for rape and prove to the world that there are some babies who are genetically born to become rapists. If those babies then grew up, became adults and then raped someone, would you then say that's fine, don't punish them since they had the genes anyway?