This is a complex question and is known technically as the problem of "Theodicy", the Judgement of God. Let me give the brief over-view. God is in a difficult position!
- On the one hand we have people saying that if God is all-powerful, why does God not simply destroy people who do evil and perpetrate abominable acts on the innocent [forgetting that we are all sinners (Rom 3:10-18) and deserve death (Rom 6:23)].
- On the other hand we have people saying that God is so loving and kind (He is, 1 John 4:8, 16) how could he ultimately destroy anyone because He is so forgiving (He is, Rom 3:23, 24).
Now, there have been numerous resolutions to this problem of how God is to be judged - is He just or loving or both?
Rom 3:4 says: "That you may be justified in your words, and prevail
when you are judged."
Regardless of which theology one adopts to resolve this we need to bear several things in mind:
- People are sinners with clouded judgement and highly imperfect. Often we need more than simple divine prompts by the Holy Spirit to get us to do the right thing. Therefore, we are told that, "Those whom I love I rebuke and discipline. So be earnest and repent." Rev 3:19. This is seen repeatedly in God's dealings with the chosen people of Israel in Judges. See also Heb 12:7-11, Prov 3:11, 12:1.
- I recall the reaction of people to the appalling pictures on news channels and newspapers where families had taken children to fight in Jihad wars in Islamic State in the middle east - children were proudly displaying by holding up the severed heads of their victims which they labelled, "infidels". Most, even otherwise 'loving" Christians, called for such people to be executed because of such hideous crimes to prevent further atrocities. That is, such people, and their children, it was urged at the time, had become so depraved that we had to prevent such crimes ever being "normalised" in any society. However, only God is the proper judge of "sufficient evil" to know when someone, or a nation, is beyond even the reach of God. This is exactly what happened to several nations in OT times when God was dealing with some of the truly evil tribes. Some were spared and some were destroyed.
- The Bible uses human language to communicate with divine messages to us. While God is infinite, omniscient and omnipotent, etc, He must still use human language communicated through human prophets. Thus, we find that the Bible often uses anthropomorphic language to communicate something - attributing human characteristics to God when He is not human at all. Therefore, we should not press some statements too literally, like "God is a jealous God", etc. That is the way it might appear, but I certain that the real divine situation is more complex and that is best that human language can muster.
- The Bible describes God's work of judgement on the wicked, as something the Lord takes no pleasure in. Eze 18:32, 33:11. Indeed, Isa describes God's eschatological work of judgements by saying: "For the LORD will rise up as at Mount Perazim. He will rouse Himself as in the Valley of Gibeon, to do His work, His strange work, and to perform His task, His disturbing task." However, when people (as all of Eze 18 makes clear) refuse to repent, God ultimately respects the choice of those who reject Him.
- The Bible also contains a promise about how things will final work out. At the time when things are revealed, there is a declaration recorded in Rev 16:4-7 -
“Righteous are You, O Holy One, who is and was, because You have
brought these judgments. For they have spilled the blood of saints
and prophets, and You have given them blood to drink, as they
deserve.” And I heard the altar reply: “Yes, Lord God Almighty, true
and just are Your judgments.”
There is yet another promise in Psalm 85:10 that suggests that God will finally resolve everything in such a way that it will be said:
Lovingkindness and truth have met together; Righteousness and peace
have kissed each other.
God is sovereign, Man is responsible. Until we know enough of all the facts about God's dealings with humanity, we must exercise faith that God can be characterised as the prophet Jeremiah said in Jer 9:24:
let the one who boasts boast about this: that they have the
understanding to know me, that I am the LORD, who exercises kindness,
justice and righteousness on earth, for in these I delight," declares
the LORD.