7 and if he rescued Lot, a righteous man, who was distressed by the depraved conduct of the lawless

Read 2 Peter 2:7 Using Other Translations

And delivered just Lot, vexed with the filthy conversation of the wicked:
and if he rescued righteous Lot, greatly distressed by the sensual conduct of the wicked
But God also rescued Lot out of Sodom because he was a righteous man who was sick of the shameful immorality of the wicked people around him.