It was a wisecrack. He wasn't stupid in the manner you think. He was merely silly to not realize that most people wouldn't recognize a wisecrack for...
And exactly what was so wrong in what he said? I have made more-or-less the same crack to a gay friend, while we were out in a bar. He came back with...