Ridiculing the rituals of religion is one of the characteristics of hypocrites, whose reality Allah Almighty has disclosed in the Qur’an. Thus, one who ridicules the rulings of the Shari`ah or those who comply with its rulings, is considered among such hypocrites whom Allah has promised to cast in the lowest depths of Hellfire.
Dr. Husam Al-Din Ibn Musa `Afana, professor of principles of Islamic jurisprudence at Al-Quds University, Palestine, states: Ridiculing the rulings stated in the Qur’an or the Prophet’s Sunnah is an act of disbelief. Allah Almighty says: (And if thou ask them (O Muhammad) they will say: We did but talk and jest. Say: Was it at Allah and His revelations and His Messenger that ye did scoff? Make no excuse. Ye have disbelieved after your (confession of) belief) (At-Tawbah 9: 65–66).

According to Ibn Kathir (may Allah have mercy on him), these verses were revealed concerning some of the hypocrites. Abu Ma`shar Al-Madini reported on the authority of Muhammad ibn Ka`b Al-Qarzhi and others: One of the hypocrites said, “I think that those reciters of ours (i.e., the Prophet’s Companions) are the most gluttonous, the most dishonest and the most cowardly at war.” The Messenger of Allah (peace and blessings be upon him) was told about that, then the hypocrite who said so came to the Prophet while he (peace and blessings be upon him) was riding his she-camel and said, “O Allah’s Messenger, we did but talk and jest.” Whereupon he (peace and blessings be upon him) said, (Was it at Allah and His revelations and His Messenger that ye did scoff? … they have been guilty) (At-Tawbah 9: 56–66).
Ibn Kahthir, in his Tafseer, also mentioned some other accounts about the occasion of the above verses. The following is one of them:
Some hypocrites accompanied Allah’s Messenger (peace and blessings be upon him) on his way for the Battle of Tabuk. Some of them said, “Do you think that the Byzantines’ fighting is like the Arabs’ fighting? By Allah! We expect to see you tied up with ropes tomorrow,” to frighten the believers.
thus, ridiculing Allah’s religion, Allah’s Messenger (peace and blessings be upon him) or the Sunnah is regarded as an act of disbelief which renders one a disbeliever.
Furthermore, ridiculing those who abide by the Law of Allah is the same as ridiculing this Law itself; doing so is regarded as disbelief. May Allah protect us all from it. It does not matter whether the ridiculer is talking seriously or in jest. The rulings of Allah’s Law are respectable; it is impermissible for one to ridicule them whether seriously or jokingly. Allah Almighty says: (And if thou ask them (O Muhammad) they will say: We did but talk and jest). The people meant in this verse said to the Messenger of Allah that they were only joking and saying things they did not mean, to divert themselves from the hardship of travel. But such matters cannot be joked about under any circumstances.