The same can be said about heterosexual sex. How do you know people are “attracted to the opposite sex” when they really just “have sex with the opposite sex.”
There are definitely gay people who get married and have kids though. An alien who doesn't understand humans might classify them as heterosexual.