This was not the first or the last time that God had been angry with the people of Israel. Quite often “the Lord’s wrath burned” against an individual or the community (e.g. Num. 32:10).
What else could God do when blatant sins were comitted? How could He not be angry?
But on the other hand, how could He be angry, when anger is a human emotion and God’s existence is above existence and He has no human form or characteristics?
It is “the axiom of Biblical thinking,” writes Abraham Joshua Heschel, that “God who created the world is unlike the world” (“God in Search of Man”, 1956 ed., p. 187). Certainly, we read of the hand of God, the mouth of God, the eyes of God, but these human terms (“anthropomorphisms”) are used simply because we have no other language, and we do not take them literally.
Nor should we take literally the adjectives that are used of God; the Rambam reminds us that the Bible is using a “via negativa” when it says, for example, that God is good – not that He is “good” on the level of human goodness, but the adjective negates the possibility that He is (God forbid) evil.
When it comes to human emotions being ascribed to the Almighty (“anthropopathy”), it is more difficult to avoid taking them literally.
It is relatively easy to be told not to believe literally in the hand of God because we know that God has no bodily shape or form. It is much harder to be told that we should not even believe that God can be angry, even though anger is criticised in Biblical and rabbinic writing (e.g. Job 5:2, Kohelet 7:9, Avot 5:11, Sotah 3b).
What we have to recognise is that anger and other emotions also have a physical basis, and it is difficult to ascribe them to a non-physical God.
Hence God’s emotions do not tell us anything about God as He is, but about our relationship with Him. What He does impacts on us; what we do impacts in some way upon Him. References to His happiness or sadness, His anger or joy, are not so much to inform us about God but to assure us that He is not indifferent.
The statement that He loves us is an assurance that we are not alone, adrift or abandoned. The references to His anger warn us that we cannot act with impunity without anyone to take notice.
As our Heavenly Parent (an anthropomorphism in itself), in some ways He resembles the earthly parent who says, “It’s only because I love you that I get angry with you!”
(On the whole subject of anthropopathy, see chapters 14 and 15 of Heschel’s “The Prophets”, 1962).