“All of my ummah will be fine except for those who commit sin openly. Part of committing sin openly is when a man does something at night and Allaah conceals it, but in the morning he says, ‘O So-and-so, last night I did such and such.’ His Lord had covered his sin all night, but in the morning he removed the cover of Allaah.” (Narrated by al-Bukhaari, 5721; Muslim, 2990)
Al-Haafiz Ibn Hajar said:
Concerning the command to cover or conceal, a hadeeth was narrated which does not meet the conditions of al-Bukhaari. This is the hadeeth of Ibn ‘Umar which is attributed to the Prophet (sallallaahu `alayhi wa sallaam), “Avoid these obscenities which Allaah has forbidden. Whoever commits any of them, let him be concealed with the concealment of Allaah.” The hadeeth was narrated by al-Haakim and is also included in al-Muwatta’ as one of the mursal reports of Zayd ibn Aslam.
Ibn Battaal said:
“Openly flaunting one’s sins implies disrespect towards Allaah and His Messenger, and the righteous believers, and is a type of stubborn provocation. Concealing sin protects one against being disrespectful in this manner, because sin brings humiliation upon the people who commit it, such as the hadd punishment if it is a sin that carries such a penalty, or the ta’zeer penalty if no hadd is enjoined. If it is something which violates the rights of Allaah, then He is the Most Generous and His Mercy precedes His Wrath. Hence if He conceals it in this world, He will not expose it in the Hereafter, but the one who flaunts it openly loses all of that.”
The hadeeth clearly condemns those who openly flaunt their sin, which implies praise of those who conceal their sin. The fact that Allaah conceals it implies that the believer must also cover himself. Whoever deliberately flaunts his sin angers his Lord, Who will not then cover him. Whoever deliberately conceals his sin out of shame before his Lord and before people, Allaah will bless him by concealing it. (Fath al-Baari, 10/487-488)