Sanitary concerns are important for some kinds of sex if people involved have STDs, especially back when protection didn't exist.
There's no single way gays have sex though, and being gay can also mean romantic attraction. Targeting gays in general isn't rational (not that many religions target gays for romantic attraction as far as I've read, even though many religious followers today are fond of doing that).
In the modern world all evidence shows that where religions try shade over the lives of gays with their dark ideas (as well as heterosexuals when trying to convince people prevention is evil, such as the Catholic church's campaigns in Africa - a deep disgrace to humanity), disease rates only go up as people get marginalized and refused information about how they can actually have safe sex. Or simply told blatant lies in the case of the church's campaigns trying to convince people condoms don't protect against AIDS.
Though the fact that there are modern inventions and advancements of course isn't going to convince anyone that believes milennium-old books are infallible, just like we see on every other science or social issue where some people are still stuck in the tribal stage.