Lut's Denunciation of His People's Deeds, Their Response and Their Punishment
The Prophet of Allah forbade them from committing evil deeds and intercourse with males, and he taught them that they should have intercourse with their wives whom Allah had created for them. Their response was only to say:
لَئِن لَّمْ تَنتَهِ يلُوطُ
(If you cease not, O Lut,) meaning, `if you do not give up what you have brought,'
لَتَكُونَنَّ مِنَ الْمُخْرَجِينَ
(verily, you will be one of those who are driven out!) meaning, `we will expel you from among us.' This is like the Ayah,
and subjected them to a terrible rain. So evil was the rain of those who were warned. - 26:173
This verse has confirmed that if a man commits sodomy, he may be punished with throwing a wall on him or by throwing him down from a high place, as suggested by Hanafi scholars, because the people of Lut (علیہ السلام) were destroyed in a similar manner. Their township was lifted and thrown on the ground. (Shami Kitab Al-Hudud)
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 166–174
The community in which Lot appeared, had crossed all limits in debauchery. Not being content with their wives, they had started indulging in homosexuality. Lot taught them God-worship and piety and attempted to dissuade them from indulging in evil deeds. Lot appeared in the community as a preacher whose personality was entirely free of falsehood and he never indulged in loose talk. Also, he completely abstained from raising matters of material interest. These events were enough to establish that Lot was fully serious about whatever he was saying. But as he spoke out against the behaviour of the community, they became his enemies. For Lot’s words to carry any weight, it was necessary for the people to fear God. But the people of his community had become completely devoid of this very virtue. Then, how could they pay attention to the prophet’s teachings?
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.