This is taken from the Covenant Life website, great excerpt from Piper on Christ's righteousness that He gives us for our sin.
From “God Justified the Ungodly,” a sermon by John Piper:
2 Corinthians 5:21 is one of the most breathtaking passages about this great
giftof imputed righteousness. “For our sake he [God] made him [Christ] to be sin who knew no sin, so that in him we might become the righteousness of God.”
Christ knew no sin. He was a perfect man. He never sinned. He lived perfectly for the glory of God all his life and in his death. He was righteous. We, on the other hand have all sinned. We have belittled the glory of God. We are unrighteous.
But God, who chose us in Christ Jesus before the
foundationof the world, ordainedthat there would be a magnificent exchange: He would make Christ to be sin—not a sinner, but sin—our sin, our guilt, our punishment, our alienation from God, our unrighteousness. And he would take the righteousness of God, that Christ had so awesomely vindicated, and make us bear it and wear it and own it the way Christ did our sin.
The point here is not that Christ becomes morally a sinner and we become morally righteous. The point is that Christ bears an alien sin and suffers for it, and we bear an alien righteousness and live by it.