The Talmud, writes Simon Holloway, is replete with jokes and wordplay, and mentions rabbis using humor to maintain their students’ attention. But the rabbis were also wary of excessive mirth:
A famous maxim has it that one of the ways in which the Torah is acquired is through a reduction of merriment, and Rabbi Shimon ben Yoḥai rules that one is forbidden to fill one’s mouth with laughter in this world. . . .
An aversion to mockery may have underlined the reason behind a prohibition of theaters and circuses, and may have also been the reason behind Rabbi Zeira’s not laughing at Rabbi Yirmiyah’s terrible joke in Tractate Niddah—although it really is a terrible joke. Rabbi Akiva . . . once remarked that levity brings one to lewdness, and that references to “mirth” in the Torah are all references to idolatry. Since he himself employs humor as a pedagogical tool, it may be that he had in mind this distinction between mockery and other legitimate forms of making fun.
Indeed, the different motivations of those who attempt to make others laugh is important, with parodying scholars being universally condemned. Rabbi Yirmiyah, whose tasteless attempt at humor . . . was the subject of no small amount of controversy, . . . was even thrown out of the academy for one of his terrible jokes.
Read more on Galus Australis: http://galusaustralis.com/2015/04/8558/counting-teeth-humour-in-the-rabbinic-literature/