It was narrated from Thawban that the Prophet (ﷺ) said:

“I certainly know people of my nation who will come on the Day of Resurrection with good deeds like the mountains of Tihamah, but Allah will make them like scattered dust.” Thawban said: “O Messenger of Allah, describe them to us and tell us more so that we will not become of them unknowingly.” He said: “They are your brothers and from your race, worshipping at night as you do, but they will be people, who, when they are alone, transgress the sacred limits of Allah.”

حَدَّثَنَا عِيسَى بْنُ يُونُسَ الرَّمْلِيُّ، حَدَّثَنَا عُقْبَةُ بْنُ عَلْقَمَةَ بْنِ حُدَيْجٍ الْمَعَافِرِيُّ، عَنْ أَرْطَاةَ بْنِ الْمُنْذِرِ، عَنْ أَبِي عَامِرٍ الأَلْهَانِيِّ، عَنْ ثَوْبَانَ، عَنِ النَّبِيِّ ـ صلى الله عليه وسلم ـ أَنَّهُ قَالَ ‏:‏ ‏”‏ لأَعْلَمَنَّ أَقْوَامًا مِنْ أُمَّتِي يَأْتُونَ يَوْمَ الْقِيَامَةِ بِحَسَنَاتٍ أَمْثَالِ جِبَالِ تِهَامَةَ بِيضًا فَيَجْعَلُهَا اللَّهُ عَزَّ وَجَلَّ هَبَاءً مَنْثُورًا ‏”‏ ‏.‏ قَالَ ثَوْبَانُ ‏:‏ يَا رَسُولَ اللَّهِ صِفْهُمْ لَنَا جَلِّهِمْ لَنَا أَنْ لاَ نَكُونَ مِنْهُمْ وَنَحْنُ لاَ نَعْلَمُ ‏.‏ قَالَ ‏:‏ ‏”‏ أَمَا إِنَّهُمْ إِخْوَانُكُمْ وَمِنْ جِلْدَتِكُمْ وَيَأْخُذُونَ مِنَ اللَّيْلِ كَمَا تَأْخُذُونَ وَلَكِنَّهُمْ أَقْوَامٌ إِذَا خَلَوْا بِمَحَارِمِ اللَّهِ انْتَهَكُوهَا ‏”‏ ‏.‏

Grade: Saheeh (Al-Albany)

The meaning here according to Shaikh al-Albani (may Allah have mercy upon him) is not that they commit sins in private but whenever they have a chance. So when they have the opportunity, they fall into the prohibitions of Allah. [Reference: Silsilatul-Huda wan-Nur no. 266].

Some scholars have understood it to mean sinning in private and then appearing upright in public. In either case, a Muslim should avoid the prohibitions of Allah privately and publicly as Allah said:

“Leave (O mankind, all kinds of) sin, open and secret. Verily, those who commit sin will get due recompense for that which they used to commit”

[6:120]

And Allah Knows Best

Mentioned by

Faisal Ibn Abdul Qaadir Ibn Hassan
Abu Sulaymaan