Dr. Muzammil Siddiqi, former president of the Islamic Society of North America (ISNA), states the following: “Islam is not against jokes. Good humor is part of Islam. Many books of Hadith have chapters on the humor of the Prophet (peace and blessings be upon him). These are called An-Nawadir or Al-Fukahah.
However, Islamic position is that even in jokes one should not tell a lie or laugh at or ridicule the laws of Allah. Allah Almighty says in the Qur’an: “If you question them, they declare (with emphasis); ‘We were only talking idly and in play.’ Say: ‘Was it at Allah, and His Signs, and His Messenger that you were mocking?'” (At-Tawbah: 65)
Sometimes these types of jokes lead to sinful acts or at least they make a person take the Haram things lightly.”