Male homosexuality is believed to have a small genetic component but is also linked to birth order. One theory is that in utero testosterone from older brothers can affect the sexuality of a younger brother.
I disagree that it makes no sense for environmental factors to lead to the onset of autism, on the basis that environmental factors can make someone gay or schizophrenic. That is to say, they can influence a personality and a mind in complicated ways that don't seem intuitive.