"And to Lot, We gave judgment and knowledge," meaning: prophethood. "And We saved him from the city that was committing impurities," meaning: that its people used to commit impurities. "Indeed, they were a people of evil, defiantly disobedient," meaning: polytheists.
﴿ولوطا آتيناه حكما وعلما﴾ يَعْنِي: النُّبُوَّةَ ﴿وَنَجَّيْنَاهُ مِنَ الْقَرْيَةِ الَّتِي كَانَت تعْمل الْخَبَائِث﴾ يَعْنِي: أَنَّ أَهْلَهَا كَانُوا يَعْمَلُونَ الْخَبَائِثَ ﴿إِنَّهُمْ كَانُوا قَوْمَ سَوْءٍ فاسقين﴾ مُشْرِكين.