***Note - answers provided from LDS perspective. Author no longer affiliated with LDS beliefs.
Whereas the other answers assert that Christ expiated on our behalf and reiterate what he did, I interpret the OP's question as asking how or why it was done. Specifically, why would a rational and non-arbitrary God allow forgiveness of sin via proxy expiation, which to the OP seems irrational. Indeed, scripture echos this sentiment - each person shall be punished for their own sins and not for another's:
Deut 24:16, Psalm 49:7, Ezek 18:20, Alma 34:11, AOF:2. How then is Christ punished for our sins?
TL;DR:
- Jesus is like our father, and we His children in that He is charged with and responsible for our salvation.
- He may therefore take responsibility for our sins, though He Himself is sinless.
- This, in combination with His unique heritage allow Him to suffer on our behalf, yet return to God's presence, and raise Himself from the dead,
- Making Jesus our intermediary and advocate with the Father.
Summary
- Implications of Adam's transgression and fall.
- God loves us, but cannot save us - a matter of jurisprudence.
- Salvation is through Christ, because he is special, and he alone can save us.
Implications of Adam's transgression and fall
God placed Adam/Eve in His Garden and gave them commandments, which if broken would carry consequences (Gen 2:17). They transgressed God's commandments, suffered the consequences, which we their progeny also suffer by inheritance (Gen 3:4-24). The consequences we all suffer is death. Death comes in two flavors (physical and spiritual) and may refer to different occurrences. This can get pretty confusing, so here's a glossary:
Death
The words "death" and "life" are often used in scripture in a way that clearly has spiritual connotations rather than physical (Rom 6:23, James 1:15).
Spiritual Death #1
Aliases: The Fall, first death (LDS only), spiritual death
When Adam/Eve transgressed, they were "cut off" from God's presence, which is sometimes referenced as a type of "death" (Gen 2:17). In LDS scripture, this is sometimes called the "first" death, because in Christian chronology it came first (D&C 29:41, Hel 14:16).
Physical Death
Aliases: The Grave, death, first death (LDS only), temporal death (LDS only)
We know this one. We all gonna die (except maybe John the beloved?). In LDS scripture this is sometimes called the "first" death, because it comes before the "second" spiritual death - not to be confused with the "first" spiritual death. Confusing, right?
Spiritual Death #2
Aliases: Hell, Hades, second death (Bible and LDS), spiritual death
At some point, every person is called to judgement before God/Christ (Rom 14:10-12) and receives either Eternal Life or Damnation for reasons that depend on who you ask, but generally in some way for rejecting Christ and His Gospel.
Rev 20:6, Rev 20:14, Rev 2:11
FYI (Life/Salvation)
Just as scripture outlines different kinds of death, so there are different kinds of salvation from death:
God loves us but cannot save us
Salvation: when I say saved, I mean salvation from death (both physical and spiritual) as outlined above.
God (the Father), is perfect (Matt 5:48), cannot lie (Heb 6:18), and has decreed punishment for sin. Hence God cannot simply revoke His promises and forgive sin, nor raise men from the dead. We on the other hand, being inheritors and participants of carnal desires, and being cut off from the ennobling influence of God that might otherwise compel us to righteousness, are utterly hopeless to regain God's presence, or Heaven (Rom 7:18-25, Rom 3:10-12).
** Note the analogue embodied in the Mosaic law, in which Priests were "forbidden" from touching a corpse (Num 19:11), but somebody else (e.g. a good Samaritan) could. Luke 10:25-37. This is echoed in Paul's writings where he contrasts God's law with Christ's mercy.
Salvation through Christ
Enter Deus Ex Machina (Jesus of Nazareth) - a third party who will satisfy the demands of God's justice and at the same time fulfill God's (and man's) desire for mercy. But first, some concerns:
- No copouts: God can't simply delegate forgiveness of sin and be exonerated by this technicality and a wink, any more than David for (not technically!) killing Uriah (2 Sam 12:9-10). That'd just be bad storytelling.
- Question of ability: We already established that we all inherit death/damnation through Adam. And Christ is descended from Adam, so how is He able to sidestep death?
- Question of justice: Even if Jesus can save us, how is that right, or just?
The answer is that Jesus was no ordinary human, and His special qualities and position allowed Him to sidestep death - both physical and spiritual.
Ability - Victory over The Grave by inheritance
Jesus was conceived of a virgin birth (Matt 1:18, Luke 1:34-35), and was essentially a demi-god (half God). He inherited God's immortality (John 5:26) and Mary's mortality so that he could both "lay down [His] life...[and] take it up again" (John 10:17-18).
Ability - Victory over Hell by virtue
Jesus inherited a carnal half-human body from His mother Mary with all its attendant temptations, but never sinned (Heb 4:4-14). Hence, if it somehow were just or right that He suffer on our behalf, that would mean He'd be cut off from God the Father (i.e. spiritual death or Hell - Matt 27-46). But, because He was without sin nothing would preventing Him from returning and ascending back to God's Kingdom.
But still, how would proxy expiation be just?
Justice - Victory over Hell by commission
Finally, we get to the OP's question: How is it just to atone for another's sins. In law you can require payment for damages from someone other than the perpetrator of those damages only if that someone is responsible for the perpetrator's actions. Such is the relationship between a parent and child, and such is the relationship between Jesus and mankind. To Jesus was committed God's Kingdom (1 Cor 15:24-28), God's authority to judge man (John 5:27), and the commission to save every last human being from before the foundation of the World (John 17:24, 1 Peter 1:20).
In summary:
- Jesus is like our father, and we His children in that He is charged with and responsible for our salvation.
- He may therefore take responsibility for our sins, though He Himself is sinless.
- This, in combination with His unique heritage allow Him to suffer on our behalf, yet return to God's presence, and raise Himself from the dead,
- Making Jesus our intermediary and advocate with the Father.