Sure, an unexpected dick is distracting, no matter who is involved. It might break your concentration, make you feel embarrassed, turn you on, or any one of a thousand reactions, none of which are homophobic.
But "your eyes start to bleed" and "your pupils dilate from the trauma", "roll for therapy", "take psychic damage", those are a different story... The punchline there is that a man seeing another mans dick is traumatic, and that's only "funny" because homophobia.
Sure, but if the wizard were a woman, the joke wouldn't work, because no one would expect her eyes to bleed and she wouldn't "need therapy" simply from seeing a dick. Those parts only "work" because it's a dude seeing another dudes dick, and that part feels sus