There must be a Group of People Who forbid Lewdness
Allah says,
فَلَوْلَا كَانَ مِنَ الْقُرُونِ مِن قَبْلِكُمْ أُوْلُواْ بَقِيَّةٍ يَنْهَوْنَ عَنِ الْفَسَادِ فِي الَارْضِ إِلاَّ قَلِيلً مِّمَّنْ أَنجَيْنَا مِنْهُمْ
If only there had been among the generations before you persons having wisdom, prohibiting (others) from Fasad (corruption) in the earth, except a few of those whom We saved from among them!
Allah, the Exalted, says that there should have been a group of wise people present among the past generations who called to good and forbade the evil and corruption that took place among them in the land.
His statement,
إِلاَّ قَلِيلً
(except a few),
This means that there were only a small number of people present among them who were of this caliber. They were those whom Allah saved at the sudden striking of His vengeance, when His anger was let lose. For this reason Allah commanded this noble Ummah (followers of Muhammad) to always have among them those who command the good and forbid the evil.
This is as Allah says,
وَلْتَكُن مِّنْكُمْ أُمَّةٌ يَدْعُونَ إِلَى الْخَيْرِ وَيَأْمُرُونَ بِالْمَعْرُوفِ وَيَنْهَوْنَ عَنِ الْمُنْكَرِ وَأُوْلَـيِكَ هُمُ الْمُفْلِحُونَ
Let there arise out of you a group of people inviting to all that is good, enjoining righteousness and forbidding evil. And it is they who are the successful. (3;104)
It is related in a Hadith that the Prophet said,
إِنَّ النَّاسَ إِذَا رَأَوُا الْمُنْكَرَ فَلَمْ يُغَيِّرُوهُ أَوْشَكَ أَنْ يَعُمَّهُمُ اللَّهُ بِعِقَاب
Verily, whenever a group of people see an evil and they do not change it, it is likely that Allah will cover them with (His) punishment.
Thus, Allah says,
فَلَوْلَا كَانَ مِنَ الْقُرُونِ مِن قَبْلِكُمْ أُوْلُواْ بَقِيَّةٍ يَنْهَوْنَ عَنِ الْفَسَادِ فِي الَارْضِ إِلاَّ قَلِيلً مِّمَّنْ أَنجَيْنَا مِنْهُمْ
If only there had been among the generations before you persons having wisdom, prohibiting (others) from the Fasad in the earth, - except a few of those whom We saved from among them!
Concerning the statement,
وَاتَّبَعَ الَّذِينَ ظَلَمُواْ مَا أُتْرِفُواْ فِيهِ
Those who did wrong pursued the enjoyment of good things of (this worldly) life,
This means that they continued in their ways of disobedience and evils and they did not heed the protesting of those righteous people, until the torment suddenly seized them.
وَكَانُواْ مُجْرِمِينَ
and were criminals.
Then, Allah
وَمَا كَانَ رَبُّكَ لِيُهْلِكَ الْقُرَى بِظُلْمٍ وَأَهْلُهَا مُصْلِحُونَ