Allah's Messenger (ﷺ) said, "Do not enter the ruined dwellings of those who were unjust to themselves unless (you enter) weeping, lest you should suffer the same punishment as was inflicted upon them."
Sahih al-Bukhari Book 60, Hadith 55