Scripture is filled with difficulties.
I find it curious that in Ps. 136:10, 15, 17-20 – each of those verses that speak of God killing people ends with "For his mercy endures forever." We don't normally make that association, unless the Bible makes it for us.
Psalm 136:10 who struck Egypt through their firstborn,
for his steadfast love endures forever;
Psalm 136:15 but overthrew Pharaoh and his army in the Red Sea,
for his steadfast love endures forever;
Psalm 136:17–18 who struck down great kings, for his steadfast love endures forever; and killed famous kings, for his steadfast love endures forever;
Here is a popular difficulty: Ezekiel 33:11 reads, 11 “Say to them, As I live, says the Lord God, I have no pleasure in the death of the wicked, but that the wicked turn from their ways and live; turn back, turn back from your evil ways; for why will you die, O house of Israel?”
That is, God does not kill the wicked for the mere sake of pleasure. If it were God’s pleasure to smite the wicked, He would be justified to smite us all, and with good reason. And though God has no pleasure in the death of the wicked, that does not keep Him from killing them sometimes in His righteous justice. I believe the verse says, “I have no pleasure in the death of the wicked” because taking pleasure in their death would most likely be in conflict with His graciousness to save.
Certainly all of the OT suggests this truth, esp. Deuteronomy: “Obey and live; rebel and die.” This is a general, spiritual law: The rebel dies and the obedient live. Often the rebel doesn’t die immediately in the midst of his rebellion (he doesn't drag them down to the gallows); and the obedient often die at an early age.
Though the Ezekiel 33 passage (and the OT in general) teaches that God does not afflict death upon the rebel simply for the sake of afflicting them [i.e., He doesn’t afflict them because he enjoys afflicting people], what is an even more remarkable Biblical truth is the fact that those whom he chooses to afflict are often able to see his mercy in the affliction when he wants them to [Lam. 3:31-33].
Nonetheless, God is not always so gracious that His grace does not keep him from killing even the supposed innocent first born of Egypt either [Ps. 135:8], which He does as a demonstration of his righteousness. The fact that He doesn’t take pleasure in it doesn’t keep Him from killing the first born of Egypt. He does it to demonstrate his righteousness -- and killing them to demonstrate his righteousness sometimes wins out over the choice to demonstrate His mercy and grace toward them.
So, "God does not take pleasure in their death…” that is, the motivation for killing them is not for pleasure, or to demonstrate power, or so He can be pleased with Himself in their death.
But He does kill them none-the-less. He chooses in the case of some to not let them see His merciful and gracious character, and when the natural consequences of their sinfulness bring His justified wrath, He does not take pleasure in it; but neither do His grace and mercy override the righteousness of His justice in that instance.
God could just as easily open their eyes to see that their repentance is the solution to His righteous justice. He is, however, faithful to do whatever he sees fit to do, to bring some back into a covenant relationship when that's what he desires to do more than demonstrate His righteous justice; where His grace wins out over retribution.
God's demonstration of grace or retribution is neither dependent on whether the wicked choose grace or mercy either (Rom 2:1-11). Many times God chooses not to open the eyes of the wicked to prevent them from knowing how gracious and merciful He is (cf. Acts 26:18); which, apart from His grace, they are unable to do on their own, so that he might demonstrate His righteous justice.
But when He chooses to demonstrate His righteous justice instead of choosing to demonstrate mercy and grace, it is not because he takes pleasure in smiting them. When He kills the firstborn of Egypt instead of rescuing them in His mercy and grace, it is not for pleasure, nor does he take pleasure in it; i.e., He doesn't do it for the *sake of pleasure*.
He does it for whatever reason he chooses (justice, righteousness, mercy, etc). Sometimes he kills and sometimes he saves; either way, He remains merciful, gracious, just and holy no matter what He chooses. It pleases Him to do just as he pleases -- and in the case of the firstborn of Egypt it pleased Him to kill them, rather than save them.