On the surface this seems a reasonable question, but when we dig deeper we find that it has problems. The answer has to do with the twin concepts of justice and holiness. Let's talk about justice first.
We have all fallen short of God's perfect standards. Since he is the moral ruler of the universe, he cannot look on violations of his perfect standards with indifference. We may be able to do this when we offend each other, but God cannot, because to tolerate anything less that perfection in his perfect universe would be an offense against perfect justice. There would be outrage if a judge failed to administer justice in his court. Imagine a judge who, upon hearing a case involving a brutal murder and rape, decided to let the guilty party go free because he wanted to act lovingly! What would the family of the victim think about his ignoring such an outrageous crime? Naturally, they would cry for justice. Letting the killer off would trivialize the brutal act and make light of the lost life of their loved one. What kind of world would we live in if every judge chose to "act lovingly and kindly" and forgive crimes instead of administering justice? We can assure you, you wouldn't like it.
God is the moral ruler of the world. He is the judge of the universe--he is the ultimate King. His laws are not arbitrary; they stem from his very character and nature, and they are given to us in order to make us more like him. Essentially all of God's laws are for our own good. He designed humans; he knows what makes us tick and how we can achieve the best performance and greatest happiness. His laws work like a manufacturers instruction and maintenance manual. If we follow them, we will come much nearer to being in what God intended us to be and reap the joy, satisfaction and fulfillment that come from it.
God is truth, and his laws are righteous. In his plea for God to save Sodom and Gomorrah from his planned destruction, Abraham cried out, "Surely you wouldn't do such a thing, destroying the righteous along with the wicked. Why, you would be treating the righteous and the wicked exactly the same! Surely you wouldn't do that! Should not the judge of all the earth do what is right?" (Gen. 18:25)
Of course, Abraham misunderstood the situation in Sodom a bit. God knew that there were no righteous people in Sodom besides Lot and his family, whom he intended to save. But the point is, Abraham made a correct statement: God, as ruler and judge of all the earth, is bound by his own character to do what is right, and this means administering justice accurately.
Sin arouses God's wrath. It is not that he irrationally loses his temper because his plans for a perfect world were fouled up. There is nothing impulsive, random or capricious about God; he's not spiteful or malevolent. His anger is neither irrational nor mysterious. He is completely principled and controlled. His anger is always provoked by wickedness and the destruction of wickedness renders to the created beings he dearly loves.
The second reason God must respond to sin is because he is holy. In fact, the attribute of holiness is applied to God more than any other attribute in the Bible. Most people misunderstand the meaning of holiness. They tend to think of it as being overly religious to the point of being somewhat out of touch with everyday reality. Or more negatively, they think of holiness as being a little self-righteous and religiously elevated above ordinary folks. But the true meaning of holiness is nothing like that. God's holiness is simply incompatible with sin. God's eyes are too pure to look on evil, and because he is perfect, he cannot bear wrong-doing (see Hab. 1:13).
Because God is holy, he cannot look upon sin with indifference. He judges sinners because his perfect character demands it. The Bible uses a couple of phrases to indicate why God must do so: First, God is "provoked by sin." The Bible tells us that he was angered when idols or foreign gods were put before him in his people's lives (see Deut. 32:16, 21). This simply means that God's perfect nature causes him to react strongly to wrongdoing. He cannot tolerate idolatry, immorality or injustice. If he did, he could not be called good. He would not be holy.
Second, we are told that God "burns with anger" at the sins of mankind (see 2 Kings 13:3). Judges 3:8 says "The Lord burned with anger against Israel." Just as our eyes burn when we look at the sun, there is something within God's nature that causes him to burn with anger at the sight of evil. Because God is holy, he simply cannot respond to sin in any other way.
Because God is holy and just, he will always do what is right. He cannot overlook our wrongdoings, for he is obligated to do what is right. The British theologian Michael Green observed that "for God just to forgive without any cost to anyone would be sheer indifferentism. It would obliterate any distinction between right and wrong. It would say that right does not matter, and that evil is a matter of indifference."
From: Evidence for the Resurrection
By: Josh McDowell and Sean McDowell.