I might asterisk "There is evolutionary advantage in keeping a variety of genes/traits 'available' - some of those genes could end up being useful in adapting to future situations," though. While it's doubtlessly true, natural selection can't think ahead like that---it simply weeds out traits that are immediately undesirable, despite the fact that those traits could be useful in other contexts. (Of course many traits, famously the sickle cell trait, have both advantages and disadvantages).
Of course; natural selection does not 'think'. The advantage in retention of 'extra' genes or traits would be more along the line of being a condition that is not selected against. Those organisms with a capacity for or tolerance of a wider variety of genes might tend to have a greater life span as an organism: they would not be as likely to die off (become extinct) as easily or as soon.
It could also be that the gene responsible for a trait with no apparent survival value is also associated with some other trait that is valuable.
I don't recall any study showing that homosexuality runs in families. Hypothetically speaking, if it does have a purely physical cause, I think homosexuality is a more or less random phenomenon, or at least not hereditary.
Whether the cause is physical or environmental, I don't think abnormal (for lack of a better word) sexual desires really function all that differently. They're healthy, strong sexual urges that, due to whatever factors, just get pointed in a different direction or in a highly specific direction. Which would be why natural selection wouldn't weed out the tendency - it doesn't differ enough from sexuality that is desirable from a reproductive point of view.