Edit:
I'm just trying to understand why Jesus would be punished. He didn't do anything wrong or how it would be just to punish someone in place of another.
Great! You see the problem! God would not “punish” the innocent Christ, that is never just, fair or righteous. We learn from the Old Testament, Christ’s life and the New Testament what is Deity’s definition of just and unjust and it would be unjust to hurt even an innocent person and unjust to allow the wicked to go unpunished or undisciplined.
God will allow at great cost to God, a willing Christ to be tortured, humiliated and murdered by wicked people to help undeserving sinful people (some being wicked). The bigger question is how Christ going to the cross helps you personally in fulfilling your earthly objective. This is the huge misunderstood topic of atonement; I could write a book on.
Just as a teaser one small part of atonement to think about:
There is this unbelievable huge “ransom payment” being made: Jesus, Peter, Paul, John and the author of Hebrews all describe it as an actual ransom scenario and not just “like a ransom scenario”. And we can all agree on: the payment being Christ’s torture, humiliation and murder, the Payer being God/Christ, the child being set free (sinners going to God), but have a problem with: “Who is the kidnapper”? If there is no kidnapper than the ransom scenario does not fit, so who is the kidnapper?
Some people try to make God the receiver of the payment, which calls God the kidnapper of His own children which is crazy.
Some people say satan is the kidnapper (this is what the Ransom Theory of atonement has), but that would mean God is paying satan when God has the power to safely take anything from satan and it would be wrong for God to pay satan.
Some say it is an intangible like death, evil, sin, or nothing, but you would not pay a huge payment to an intangible?
There is one very likely kidnapper and that is the person holding a child back from entering the Kingdom to be with God. When we go to the nonbeliever, we are not trying to convince them of an idea, a book, a doctrine or theology, but to accept Jesus Christ and Him crucified (which is described as the ransom payment). If the nonbeliever accepts the ransom payment (Jesus Christ) there is a child released to go to the Father, but if the nonbeliever refuses to accept Jesus Christ and Him crucified a child is kept out of the Kingdom. Does this all sounds very much like a kidnapping scenario?
Yes, Christ is the ransom payment for all, but the kidnapper can accept or reject the payment. If the kidnapper rejects this unbelievable huge payment, the payers of the ransom are going to be upset with that kidnapper.
There is a lot more to say about this, but this is an introduction.