Christ bore the suffering due for our sins, in our place. One might worry whether this makes any moral sense. Assume a retributive view of punishment, on which wrongdoing provides a reason, not based on the protection of society or the reformation of the wrongdoer, to treat the wrongdoer harshly.
Now, the best argument I know for a retributive view of punishment is the parallel with reward. Doing more than one's duty is a reason to be rewarded, in proportion to how far above one's duty one has gone. By parallel, doing less than one's duty is a reason to be punished, in proportion to how far short of one's duty one has fallen.
But in reward situations, we fully accept reward substitution. Sally has earned a large cash prize as a reward for her life's work in getting the Elbonians and Olbenians to forget their past differences and live in harmony. She directs the bestower of the prize to give it to the Orphans of Mixed Elbonian-Olbenian Descent Protection Fund. Some consideration of justice would have been satisfied by giving the prize to Sally. But when the substitution is made, the very same consideration of justice is still satisfied.
If retributive punishment is the flip side of retributive reward, and if we are untroubled by reward substitution, we should be equally untroubled by penalty substitution. Fred's receipt of harsh treatment that was due Sally could satisfy the reason of justice to treat Sally harshly, just as the Orphan Fund's receipt of the money due Sally could satisfy the reason of justice to reward Sally.
There are, of course, some consent conditions on reward substitution. For y's receipt of a good that was to be x's reward to be a valid substitution, x has to consent. Moreover, it may be that y has to either consent or be presumed to consent to receiving the good qua substitution for x. If Hitler got the Nobel Peace Prize and directed the money to my research fund, saying that my research work promotes his ideals, I would have very good reason to refuse. And if I were given the money despite my refusal, it is not clear that it would be a valid substitution. Further, maybe the persons who were the primary benificees of x's supererogatory action--the ones by benefiting whom x gained the reward--need to consent or be presumed to consent to the substitution.
It would be very interesting if penalty substitution required the same consent conditions. Thus, if Sally is due harsh treatment, and Fred offers to suffer it for her (so, Fred's consent is built into the story), this is only a valid substitution if Sally consents to it. This would have the theological consequence that Christ's sacrifice cannot be validly applied in justice to those who never consent to its application. Likewise, if the primary benificees need to consent in reward substitution cases, the primary individual against whom the wrong was done need to consent in penalty substitution cases. If so, this means that Christ's sacrifice requires the view that the primary individual against whom the wrong was done is always God. "Against you, you alone, have I sinned," says the Psalmist, emphasizing this.