Before we answer why Jesus had to die for our sins, we will first briefly answer why humans are under the penalty of death and need a Savior.
God the Father is the Creator of all things through Jesus (Romans 11:36, Hebrews 2:10). He therefore owns everything, including every human who has or will ever exist, and has the divine right to set the standards regarding how his creation should live.
Sin is the violation of his righteous laws (his standards), either in the letter or in their intent, which are an expression of his perfect love (James 2:10 - 11, 1John 3:4, etc.). Since God's moral laws are intrinsic to His eternal character and divine nature, any violation of his perfect way of living requires a response.
All humans sin (Romans 3:23) and bring upon themselves His righteous judgment which demands the death penalty (Romans 6:23). Without God's plan of salvation, which entails the sacrifice of Jesus, all humans would live a brief physical existence on earth, die, and stay dead for all eternity.
In the first prophecy of the Bible God alludes to the fact that Jesus, who would divest himself of his divinity and be born of a woman, would come to save mankind (Genesis 3:15). The apostle Paul clearly tells us that, though they were commanded (see Leviticus chapters 4 and 16, Deuteronomy 12, etc.), the animal sacrifices under the Old Covenant were never meant to take away sins.
For the law, having only a shadow of the good things that are coming, and not the image of those things, with the same sacrifices which they offer continually year by year, is never able to make perfect those who come to worship . . .
On the contrary, in offering these (animal) sacrifices year by year, there is a remembrance of sins because it is IMPOSSIBLE for the blood of bulls and goats to take away sins (Hebrews 10:1, 3 - 4, HBFV throughout).
Why not just forgive us?
If God arbitrary cancelled the penalty of breaking his law then how can men and women know that He is just in His actions? How would we know whether He would punish sins when they should be punished?
God certainly could have decided to forgive us when we repent without requiring that the sacrifice of Jesus be applied when we made our request. This would not impress upon humans, however, as deep as possible, his love and total commitment for his creation.
Why it had to be God
The Creator God of the Old Testament was none other than the pre-incarnate Jesus Christ (for more information see our article "Who is the God of the Old Testament?")! He is the one who, through Moses, gave all the commandments and laws to ancient Israel. He is the originator of the Law for humanity.
Since Jesus was the originator of the Law, He is the only one who could take, in His own Person, the penalty resulting from breaking it and stand in humanity’s place for it. As God (John 1:1 - 3, Colossians 1:16, etc.) and a member of the Godhead, the life of Jesus is worth more than all human lives combined.
If the one Who had created man died, complete and total payment for human sin could be made, and reconciliation would be possible for all. His sacrifice, therefore, completely pays the penalty for all sin either past, present or future (Hebrews 2:9, 10:10, 12, 14). He had to die so that we could live.
The tension between God's righteous judgment and His perfect love can best be described by the following quote.
"God's holiness, righteousness and justice are immutable parts of His character, so He exercises judgment on sin as One who is sovereign in His moral kingdom.
"Yet, he himself has fulfilled that righteous penalty in the person of His Son (Jesus) so that, without violating His holy nature, He guarantees forgiveness and justification to all who believe" ("The Bible has the Answer" by Morris and Clark, 1976, page 153).
Jesus had to die because he was the only Being in the entire universe who, through his sinless sacrifice, could pay the ultimate penalty for sin so that man could be saved.