Alright, here's my response.
A Western, Protestant Christian Perspective
There are some background things which need to be discussed regarding why punishment for sin is necessary at all.
First, God is holy and pure. Sin violates His nature so fundamentally that He cannot even look at sin.
Habakkuk 1:13 You who are of purer eyes than to see evil and cannot look at wrong.
Not only can God not abide the sight of sin, but sin, being in direct violation of God's nature, cannot bear His perfect and full presence, for to do so is to reveal the absolute evil of sin and to invite destruction in the very presence of God.
Isaiah 6:5 And I said: “Woe is me! For I am lost; for I am a man of unclean lips, and I dwell in the midst of a people of unclean lips; for my eyes have seen the King, the Lord of hosts!”
Psalm 24:3-4 Who shall ascend the hill of the Lord? And who shall stand in his holy place? He who has clean hands and a pure heart, who does not lift up his soul to what is false and does not swear deceitfully.
Job 42:5-6 "I had heard of you by the hearing of the ear, but now my eye sees you; therefore I despise myself, and repent in dust and ashes.”
God will judge every person according to His law and justice.
Job 37:23 The Almighty—we cannot find him; he is great in power; justice and abundant righteousness he will not violate.
Ecclesiastes 12:14 For God will bring every deed into judgment, with every secret thing, whether good or evil.
2 Corinthians 5:10 For we must all appear before the judgment seat of Christ, so that each one may receive what is due for what he has done in the body, whether good or evil.
Second, humanity is sinful, every human being, and our sin separates us from God.
Romans 3:22-24 For there is no distinction: for all have sinned and fall short of the glory of God, and are justified by his grace as a gift, through the redemption that is in Christ Jesus, whom God put forward as a propitiation by his blood, to be received by faith.
We cannot earn our way into heaven by following God's law, because we are not perfect enough to follow God's law. If we could earn our way into heaven, there would be no reason for Christ to die.
Galatians 2:21 I do not nullify the grace of God, for if righteousness were through the law, then Christ died for no purpose.
When Christ came, He explained that the standard of God's law applies to every area of our lives - not only our actions (do not steal, do not murder, etc), but to our very thoughts.
Matthew 5:21-22 “You have heard that it was said to those of old, ‘You shall not murder; and whoever murders will be liable to judgment.’ But I say to you that everyone who is angry with his brother will be liable to judgment; whoever insults his brother will be liable to the council; and whoever says, ‘You fool!’ will be liable to the hell of fire.
Mattew 5:27-28 “You have heard that it was said, ‘You shall not commit adultery.’ But I say to you that everyone who looks at a woman with lustful intent has already committed adultery with her in his heart.
Matthew 5:48 You therefore must be perfect, as your heavenly Father is perfect.
This is an impossible standard to achieve. Indeed, those who commit right actions but do not actually believe in God or have accepted His grace will be punished.
Matthew 7:21-23 “Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but the one who does the will of my Father who is in heaven. On that day many will say to me, ‘Lord, Lord, did we not prophesy in your name, and cast out demons in your name, and do many mighty works in your name?’ And then will I declare to them, ‘I never knew you; depart from me, you workers of lawlessness.’
Before Christ came, the sins of the people were atoned for by animal and plant sacrifices offered to God on a regular basis, which was necessary because people keep sinning.
Hebrews 9:22 Indeed, under the law almost everything is purified with blood, and without the shedding of blood there is no forgiveness of sins.
The sacrifices of sinful flesh, though, cannot purify our hearts. This is kind of where the analogy of the courtroom falls apart as it really isn't like a courtroom here on earth. As God is the judge, He determines the fit punishment, and the punishment for sin is death as that is the only way to remove it from His presence. The punishment is necessary in order to satisfy His holy and perfectly pure nature. Not punishing the sin would in essence be judging the violation of His law as "ok".
This is where the doctrine of the Trinity comes in as well, which I will not get into. To put it simply though, in order to allow us as sinful beings to enter the presence of God and spend eternity with Him in a sinless state, a member of the Trinity, the Son of God Jesus Christ, offered Himself as a "scapegoat", or a stand-in for humanity's sin. As a perfect, sinless being who never violated God's nature Himself, His sinless blood and eternal sacrifice (for when He died on the cross the weight of sin for all of humanity, for all of time was put on Him, and He experienced separation in Hell from God the Father as God had to turn His face from Jesus as He cannot look upon sin) purify us before God.
Romans 5:7-9 For one will scarcely die for a righteous person—though perhaps for a good person one would dare even to die— but God shows his love for us in that while we were still sinners, Christ died for us. Since, therefore, we have now been justified by his blood, much more shall we be saved by him from the wrath of God.
Hebrews 9:13-14 For if the blood of goats and bulls, and the sprinkling of defiled persons with the ashes of a heifer, sanctify for the purification of the flesh, how much more will the blood of Christ, who through the eternal Spirit offered himself without blemish to God, purify our conscience from dead works to serve the living God.
God did this because He knows that none of us can live up to His perfect standards as we are imperfect beings. This also lays all of humanity on equal footing, because our salvation is not dependent on anything that we did, but rather on God's action.
This is why Christians should always be filled with humility and love towards other people. God gave us His ultimate grace and mercy, and as Christians it is our responsibility to demonstrate that to everyone around us.
Unfortunately, we are still not perfect, and we still often fail to live up to God's standard of perfection.
Ephesians 2:8-9 For by grace you have been saved through faith. And this is not your own doing; it is the gift of God, not a result of works, so that no one may boast.
Galatians 2:16 Yet we know that a person is not justified by works of the law but through faith in Jesus Christ, so we also have believed in Christ Jesus, in order to be justified by faith in Christ and not by works of the law, because by works of the law no one will be justified.
However, if we reject Jesus' sacrifice by rejecting Him, then we reject His substitution and place ourselves back under God's justice. As sinful beings, we cannot live in the presence of God in heaven, so judgment places us in Hell, separated from God.
And, to bring it full circle back to the topic...as you know, the exact nature of Hell and whether there is a Purgatory is up to a tremendous amount of debate within Christianity. The one commonality though is that Hell is a place of separation from God and where we are acutely and fully aware of our failure.
John 3:16-18 For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life. For God did not send his Son into the world to condemn the world, but in order that the world might be saved through him. Whoever believes in him is not condemned, but whoever does not believe is condemned already, because he has not believed in the name of the only Son of God.
That was an extremely quick and dirty overview, which may be ironic given the length of the post.
None of this means that people can't or don't do good things, but simply that no matter how many good things we do we cannot live up to the standard of perfection that God requires.