Islam wants Muslims to strive hard to have a society that is free from sins. It does not strive to apply the legal penalties; nor does it endeavor to apply hudud to those who deserve them. It is reported that after the Prophet (peace and blessings be upon him) had carried out the prescribed legal penalty for adultery on Ma`iz Al-Aslami, he said, “Avoid this abomination which Allah has prohibited. So, whoever is involved should screen himself with the concealment of Allah and turn to Allah in repentance, for whoever confesses to a sin, we carry out the related prescribed legal penalty stated in Allah’s Book on him.”
The eminent Muslim scholar Sheikh Yusuf Al-Qaradawi, states the following: I would like to stress an important fact regarding the issue of hudud: Islam does not strive to apply hudud; nor does it endeavor to apply hudud to those who deserve them; nor does it fix wire tapes here and there to track wrongdoers; nor does it set hidden “cameras” to photograph criminals while committing crimes; nor does it allow or motivate peace officers or secret agents to spy on outlaws to arrest them red-handed! Rather, we find that the teachings of Islam in this concern are very decisive in preserving the inviolability of people’s privacy, and in forbidding certain individuals or even the ruling authorities to spy on people or invade their privacy.

Al-Hakim narrated on the authority of `Abdur-Rahman ibn `Awf: One night `Abdur-Rahman patrolled with `Umar in Madinah, and while they were patrolling, they noticed an oil lamp in a house, so they headed for it. When they approached, they were stopped by a closed door behind which they heard loud voices of some people. `Umar said to `Abdur-Rahman while pressing the latter’s hand, “Do you know whose house it is?” `Abdur-Rahman said, “No!” Umar said, “It is the house of Rabi`ah ibn Umayyah ibn Khalaf, and they are all drunk now, so what do you think?” `Abdur-Rahman replied, “I think we have done what Allah has prohibited, for Almighty Allah prohibited us saying, (And spy not) (Al-Hujurat 49:12), yet we spied!” Upon that `Umar moved away and left them alone. (Reported by Al-Hakim in Al-Mustadrak, vol. 4, p. 377, who said that its chain of transmitters is authentic, and Adh-Dhahabi agreed with him.)
Moreover, Abu Dawud and also Al-Hakim narrated on the authority of Zayd ibn Wahb: A man came to Ibn Mas`ud and said to him, “Would you come and convict Al-Walid ibn `Uqbah (for the sin of drinking) as wine is dripping from his beard?” Ibn Mas`ud said, “The Messenger of Allah (peace and blessings be upon him) forbade us to spy, so if he appears, we will convict him (and apply the legal penalty).” (Collected by Al-Hakim [vol. 4, p. 377] who deemed it authentic, yet Adh-Dhahabi did not comment on its authenticity; and by Abu Dawud in Al-Adab, no. 4890.)
In addition, it is narrated on the authority of four of the Prophet’s Companions—Jubayr ibn Nafir, Kathir ibn Murrah, Al-Miqdam ibn Ma`dikarib, and Abu Umamah Al-Bahili (may Allah be pleased with them)—that the Prophet (peace and blessings be upon him) said, “If a caliph maintains suspicion against people, he will corrupt them.” (Collected by Abu Dawud in Al-Adab, no. 4889, and also by Al-Hakim (vol. 4, p. 378) who, just like Al-Dhahabi, did not comment on its authenticity and mentioned it in Sahih Al-Jami` As-Saghir , no. 1885 and attributed its narration to Imam Ahmad and At-Tahawi.)
Rather, we find that the Prophetic hadiths make it strongly desirable that the Muslim should seek concealment of disgrace for himself and for others. To illustrate, Ibn `Umar (may Allah be pleased with him) narrated that after the Prophet (peace and blessings be upon him) had carried out the prescribed legal penalty for adultery on Ma`iz Al-Aslami, he said, “Avoid this abomination which Allah has prohibited. So, whoever is involved should screen himself with the concealment of Allah and turn to Allah in repentance, for whoever confesses to a sin, we carry out the related prescribed legal penalty stated in Allah’s Book on him.” (Collected by Al-Hakim who did not comment on its authenticity, and Adh-Dhahabi implied that it is authentic according to Al-Bukhari and Muslim’s conditions of authentic hadith, vol. 4, p. 383.) The honorable Prophet carried out that prescribed legal penalty on Ma`iz after the latter had come to him four times, confessing to his sin. The Prophet (peace and blessings be upon him) tried several times to absolve him and help him say what might have invalidated the whole case as well as the penalty. Yet, Ma`iz insisted, just like that woman from the tribe of Ghamid.
Abu Burdah narrated on the authority of his father: “We, the Companions of Muhammad, used to say that if Ma`iz and that woman (from Ghamid) had not come for the fourth time (after the Prophet had sent them back) the Messenger of Allah (peace and blessings be upon him) would not have summoned them.” (Collected by Al-Hakim who deemed it authentic according to Al-Bukhari and Muslim’s conditions of authentic hadith, and Adh-Dhahabi agreed with him [vol. 4, p. 383], and the meaning of the hadith is stated by Al-Bukhari and Muslim on the authority of Ibn `Umar.)
Moreover, the Prophet (peace and blessings be upon him) said to Hadhal, the one who urged Ma`iz to confess to adultery, “If you had screened him with your garment, it would have been good for you.” (Stated by Adh-Dhahabi in his Al-Mustadrak vol. 4, p. 385, who deemed it authentic. Yet, the hadith was unintentionally omitted from the original printed copy of the book, and it appears that Al-Hakim collected it and deemed it authentic.)
Moreover, Abu Hurairah narrated that the Messenger of Allah (peace and blessings be upon him) said, “He who conceals the faults of his Muslim brother in this world, Allah conceals his faults in this world as well as in the Hereafter.” (Collected by Abu Dawud in the chapter “Legal Penalties,” no. 4377, and Al-Mundhiri attributed its narration to An-Nasa’i. Al-Hakim also collected it and deemed it authentic, and Adh-Dhahabi agreed with him [vol. 4,p. 363].) Abu Hurairah also narrated that the Prophet (peace and blessings be upon him) said, “There is not a servant (i.e., a person) who conceals the faults of his fellow in this world except that Allah conceals his (the former’s) faults on the Day of Judgment.” (Collected by Al-Hakim who deemed it authentic according to Al-Bukhari and Muslim’s conditions of authentic hadith, and Adh-Dhahabi agreed with him [vol. 4, p. 383].) As the former hadith states the reward for concealing the faults of one’s fellow Muslim, the latter hadith generally states the reward for concealing the faults of any person.
For more illustration, Kathir, the freed slave of `Uqbah ibn `Amir, narrated that the Messenger of Allah (peace and blessings be upon him) said, “Whoever sees `awrah (someone’s fault or something so private, physically or spiritually) and conceals it is like one who rescues a buried-alive little girl from her grave.” (Collected by Abu Dawud in Al-Adab, no. 4891. Al-Hakim also collected it and deemed it authentic, and Adh-Dhahabi agreed with him [vol. 4, p. 384].)
In addition, we find that the Islamic teachings are so explicit in urging people to tolerate and forgive in applying hudud when the crime is only related to the rights of individuals, as in the case of robbery, as long as the case does not reach the judiciary, where there is no room for tolerance or forgiveness. In this regard, it is narrated on the authority of `Abdullah ibn `Umar: “Pardon in hudud among yourselves, for the legal penalty for any wrongdoing reported to me will imperatively be applied.” (Collected by Abu Dawud in the chapter “Legal Penalties,” no. 4376, and An-Nasa’i in the chapter “Cutting Off the Hand of the Thief,” no. 4889. Al-Hakim also collected it and deemed it authentic, and Adh-Dhahabi agreed with him [vol. 4, p. 383].)
`Abdullah ibn Mas`ud said: I remember the first case when the Messenger of Allah (peace and blessings be upon him) cut off a man’s hand. A thief was brought to him so he ordered that the thief’s hand be cut off, and it seemed that sorrow appeared on the face of the Messenger of Allah (peace and blessings be upon him). They (the Companions) said, “O Messenger of Allah! It seems that you did not like to cut the man’s hand off!” He replied, “But what could have stopped me (since you brought him to me)? You should not be assistants of Satan against your (Muslim) brother! When a wrongdoing is reported to the imam (ruler), the related prescribed legal penalty has to be applied! Verily, Allah is All-Forgiving and He likes forgiveness. Allah Almighty says, (Let them forgive and show indulgence. Yearn ye not that Allah may forgive you? Allah is Forgiving, Merciful.) (An-Nur 24:22).” (Collected by Al-Hakim who deemed it authentic, yet Adh-Dhahabi did not comment on its authenticity [vol. 4, p. 382–383].)
Furthermore, whenever a man came to the Prophet (peace and blessings be upon him) confessing that he deserved a legal penalty, without mentioning the sin, the Prophet never asked him about the sin or how he did it. Rather, the Prophet used to regard such confession as sincere repentance and remorse. Thus, the Prophet used to regard it (the man’s confession) as expiation, especially if the man performed Prayer along with the Prophet (peace and blessings be upon him). To illustrate, in the chapter “A Man Who Confesses to a Sin Without Mentioning What It Was,” Abu Dawud narrated on the authority of Abu Umamah: A man came to the Messenger of Allah (peace and blessings be upon him) and said, “O Messenger of Allah! I committed a wrongdoing that deserves a legal penalty, so carry it out!” The Prophet said, “Have you performed ablution when you have come?” The man replied, “Yes.” The Prophet said, “Have you performed Prayer along with us when we have performed Prayer?” The man replied, “Yes.” The Prophet then said, “Then go, for Almighty Allah has forgiven you.” (Collected and narrated by Muslim once as a whole and once in brief, and collected by Abu Dawud and An-Nasa’i, and the aforementioned text is from Abu Dawud’s narration. It is also collected by Al-Bukhari and Muslim on the authority of Ibn Mas`ud.)
Besides, some of the early Muslim scholars maintained that the imam (ruler) or the judge has the right to inactivate the application of a legal penalty in case of repentance, if there are signs of sincere repentance. This is the opinion supported by Ibn Taymiyah, the Sheikh of Islam, and his student, the researcher Ibn Al-Qayyim. It is also the opinion I maintain when we codify the legal penalties in our modern age.