God is a God of justice and judgement both in old and new testament;the people were exceedingly wicked and God gave them a chance to repent and they refused.God still showed mercy even in His judgement...saving Lot and those who would go with him and allowing Lot to stop in Zoar and in doing so saved that city.