Why does God resort to genocide and destruction? According to this answer, God does not want to destroy sinners. And yet, there are several accounts in the Bible of God doing just that. Sodom and Gomorrah is one example, another one is the flood or the numerous atrocities against the Egyptians in Exodus, just to mention a few.

Now, with God being omnipotent, and thus with presumably an infinite number of ways of dealing with these situations, why does he resort to the most cruel and barbaric methods like genocide and murder? It doesn't seem like something a god who loves everyone would do, especially one with the power to resolve these situations in more peaceful ways.
Remember that God is completely loving, but that he is also completely just.
A truly just God who already decreed that the punishment for sin is death is morally obligated to follow through on that punishment.

As an example, remember in Daniel 6 that Daniel broke the law about praying to any 'god' other than Darius. Despite the fact that Darius liked Daniel, when Daniel [disobeyed], Darius was obligated to throw Daniel into the lions den.

To do any less is to turn God into a liar (something which he by definition is not). He is tautologically constrained by goodness, justice, and omnipotence to act.
Indeed, the real question isn't &quot;Why did God punish these towns (Sodom, the death of the firstborn in Egypt, the inhabitants of Canaan, the world right before the flood)?&quot;  but rather, &quot;Why doesn't he wipe out more civilizations?&quot;
Is God merciful ?
The answer to that is his mercy, as evidenced by Jonah.
Jonah, as you will remember, was sent to Ninevah by God to demand they repent. Jonah did his duty, however grudgingly, simply telling telling them &quot;Thirty days and Ninevah shall be destroyed.&quot; When Ninevah heard this, however, it repented.  As a result, God changed his mind and decided to wipe them out.
That's when Jonah gets upset.  Here's what he says in Jonah 4:2:

He prayed to the LORD, O LORD, is this not what I said when I was still at home? That is why I was so quick to flee to Tarshish. I knew that you are a gracious and compassionate God, slow to anger and abounding in love, a God who relents from sending calamity.

In response, God gives Jonah a living parable:

Then the LORD God provided a vine and made it grow up over Jonah to give shade for his head to ease his discomfort, and Jonah was very happy about the vine. But at dawn the next day God provided a worm, which chewed the vine so that it withered. When the sun rose, God provided a scorching east wind, and the sun blazed on Jonah's head so that he grew faint. He wanted to die, and said, It would be better for me to die than to live.
But God said to Jonah, Do you have a right to be angry about the vine? I do, he said. I am angry enough to die. But the LORD said, You have been concerned about this vine, though you did not tend it or make it grow. It sprang up overnight and died overnight. But Nineveh has more than a hundred and twenty thousand people who cannot tell their right hand from their left, and many cattle as well. Should I not be concerned about that great city?

Why does justice demand death ?
Finally, it is reasonable to ask, why should a just God demand death for sin. After all, he is the one who pronounced originally that &quot;in the day you shall eat thereof, you shall surely die.&quot;  (Here, I'm quoting Gen 2:17. Yes, Romans 6:23 is where I can unequivocally state the wages of sin is death, but I'm trying to stay in chronological order here!)
Here I want to delve into a bit of (hopefully informed) speculation.  The Jews understood that one could not look upon God and live.  (That's why (a) Jacob was amazed that he wrestled with God and lived, and (b) Moses, who asked to see God's face was told that he could not see it and live, but God did deign to show him his back.)
I don't think it is an unreasonable jump to suggest that when sinful man looks upon a completely holy God, he becomes so aware of his own inferiority that he cannot live with that knowledge.  (Its like that feeling of coming back to work after a wonderful Christmas vacation. The shock is killer!)
To look, unfettered upon the face of God, would be to literally die of shame.
Indeed, Dante says that the gates of hell are locked from the inside - Its not that God cannot abide man in heaven, but that sinful man cannot abide God.