The most brutal example of divine justice is found in the New Testament, not the Old. We see the most violent expression of God's wrath and justice in the crucifixion of His own Son. If anybody had room to complain that He was not being treated fairly, it was Jesus Christ, who was not guilty of even one sin! He was the only innocent person who ever lived, yet He suffered a horrible, cruel death. If we were to become upset or offended at something that seems to be unjust, this would be it.
The crucifixion, similar to the Flood, the casting out of the Amorites, and so forth, is simultaneously the most just and the most gracious act in history. It would have been absolutely diabolical of God to punish Jesus if His Son had not first voluntarily taken on Himself the sins of all the world. Even though He was innocent to that point, once He took upon Himself that concentrated load of sin, He became the most repugnant thing that ever existed on earth before God. He became an obscene and accursed thing, and God executed His wrath. He acted in total impartiality. God could not overlook sin, even when it touched His Son.
Jesus Christ did this for us. Christ took the justice that was to fall on us, and He paid for it with His priceless life. It is the "for us" aspect that displays the majesty of the grace of God.
We cringe at God's justice because it is so unusual, since most of the time He is so gracious. Human nature deceives us into taking it for granted, but we need to keep it in mind because it just as integral to His character.