Kid at Wish: I wish I could be Batman.
Doctor: Okay, shoots mum and dad. Doctor: I guess now you’ll have to be gay, you wanted to be like Batman.
Kid at Wish: I wish I could be Batman.
Doctor: Okay, shoots mum and dad. Doctor: I guess now you’ll have to be gay, you wanted to be like Batman.
Okay, so this joke is funny because it plays on the dark origin story of Batman, who became a superhero after his parents were murdered. The punchline is that the doctor makes the kid's wish come true in a twisted way by killing his parents and then assumes he's gay because... well, you know. Basically, it's saying Batman is gay which he is not, or at least, he's never officially come out, which is exactly something a dumb person like you might think.