South Park isn't exactly homophobic, it seems to treat homosexual and transexual characters such as Ms. Garrison with more respect than the rest of the cast, tbh.
The jokes kind of stem from this idea that if something is different than the expectation then that makes it funny, including societal expectations like omission of poop or sexuality: like when Tad Mikowski gets distracted by "start the reactor" from the movie Total Recall.