Sanhedrin 58-64
No Laughing Matter
Rav Nachman said, "It is forbidden to make fun of anything except for making fun of idolatry, which is indeed permitted to ridicule."
Rav Nachman explains the source for this teaching in the gemara as being based on verses in Yeshayahu (46:1) that ridicule, mock and laugh at idols: “Bel squats; Nebo soils himself...” Rashi (in Sefer Yeshayahu) explains that the prophet is making fun of these two Babylonian idols: “The deities of Babylon squatted and soiled themselves. This is an expression of ridicule of the idols.” Rashi on our daf expounds on the nature of this ridicule: “Even though the idols are not animals and don’t have excrement, the verse speaks in this manner in order to make fun of idols and idolatry.”
A practical example of making fun of idols in our day is jeering at the name of the wicked Haman and the merrymaking we enjoy each year on Purim when we celebrate the miracle of being saved from the genocidal plan of the wicked Haman who demanded being treated as an idol.
Sanhedrin 63b