The target of punishment
Matarat haonesh מטּרת הענשׁ
God does not punish perpetrators for His own sake, but for the good of the sinner alone and the welfare of humanity and to direct him/her to the path of truth. For this reason the punishment of the sinner is not contrary to God's mercy. The Holy Scripture tells us that God punishes His children entirely with the target to bring them up and that He does not yearn for the death of the godless people, He wishes that they leave their sinful way and that they stay alive.
And thou shalt consider in thy heart, that, as a man chasteneth his son, so יהוה thy God chasteneth thee. (5M 8:5)
For whom יהוה loveth He correcteth, even as a father the son in whom he delighteth. (Proverbs 3:12)
Have I any pleasure at all that the wicked should die? saith יהוה God; and not rather that he should return from his ways, and live? (Eze 18:23)
God experiences no benefit or harm from good or evil deeds. Good and evil, performed by humans causes benefit or harm to person who performs the good or evil deed and also to the community in which this person lives, because it is written in book of Job:
If thou hast sinned, what doest thou against Him? And if thy transgressions be multiplied, what doest thou unto Him? If thou be righteous, what givest thou Him? Or what receiveth He of thy hand? Thy wickedness concerneth a man as thou art; and thy righteousness a son of man. (Job 35: 6-8)
From all the verses of Holy Scripture, which speaks about God's anger and about the punishment for sinners, it is necessary to be understood in the above mentioned sense, ie. that God does not do it for His own benefit but for the benefit of the sinner alone and the whole of humanity.