Some of the scariest parts of the Bible are God's judgements against entire groups of people. We generally think of God as a just God. And we should, because He is. But what do we do when He strikes down entire cities?
The correct answer, of course, is repent. It's none of our business what God does to whom and when or for why. Who are we? We're nothing. It is not our right to judge God.
But can we ask questions? Absolutely. Unlike other religions, where the answer to any tough question is "stop asking that question", Christians serve a rational God who, while He cannot be fully understood, at least allows us to use our brains. After all, He gave us those brains for that very purpose.
Abraham understood both his place and God's sovereignty when he interceded for Sodom and Gomorrah. He began by asking God if He would spare the cities for just 50 righteous people. God said yes, and so Abraham began testing the fences a bit. What about 45? Or 40? Eventually, Abraham said "let not the Lord be angry, and I will speak one more time." This time, he asked if God would spare Sodom for just 10 righteous people.
"Let not the Lord be angry" shows Abraham's submission. He knew he was probably pushing it, yet for whatever reason, he saw fit to ask. And the Lord was merciful enough to answer. For just 10 righteous people, God would not destroy the cities in spite of the outcry against them.
This incident, among others, settles the question that comes to most of our minds when we hear about these terrible judgements. What about the innocent people? Answer: There weren't any. When God went so far as to destroy a culture, everyone in that culture deserved the destruction.
God's patience is beyond reproach. He will tolerate evil for a time, while repentance is on the table, and for the sake of the righteous. But the consistent picture we see when these judgements occur is that the ones being judged are at the height of their evil, too stubborn to repent, and the righteous are not among them.
We may never fully understand God's wrath. The judgements of the past serve only one purpose: They show us the side of God we don't want to be on. The horror we feel when we read these judgements is only amplified by knowing we deserve the same. But praise be to God, this was never His will. We are never going to suffer those judgements, because He has saved us from them through His Son. Let us therefore respond in the way of those who were not judged: Repent in sackcloth and ashes, and worship the God who loves us.