The concordance rate of homosexuality is significantly higher among monozygotic twins than among dizygotic twins. This suggests a large genetic factor. It is true that the concordance rate among monozygotic twins is not 100%, so genes do not explain everything. However the environmental contribution may come from the prenatal environment. Though twins obviously share the same uterus, they do not necessarily share the same environment. One twin may be exposed to certain hormones, pathogens, or viruses that shape his or sexuality that the other twin is not exposed to.
edit: Lets not forget that many gays are still in the closet. So in a study, many men may claim to be straight when they're really gay, thus lowering the actual concordance rate.