Dear Dr Shabbir,
It's just a colloquial expression for saying that the joke is funny but also bad (and especially when the joke is a pun). But it's not that the joke is in bad taste.
Also, a pun is a joke that plays on words. So in Prof. Rafi's joke, the word play is in 'Hebrew' - which can also be read as two words: 'He brews' it. It's a bad pun, but elicits a chuckle.
Does that help? It's tricky to explain! :)