He [God] made Him [Jesus] who knew no sin to be sin for us, that we might become the righteousness of God in Him. (2 Corinthians 5:21)
God made Jesus, who knew no sin, to be sin for us, that we might be made the righteousness of God in Jesus. The exchange there is very clear: Jesus was made sin so that we might become righteousness. Notice that it is not by our own righteousness that we are made righteous, but by the righteousness of God. In Matthew 6:33, Jesus said, “But seek first the kingdom of God and His righteousness, and all these things shall be added to you.”
The only righteousness acceptable in heaven is the righteousness of God received through faith in Jesus Christ. Isaiah 64:6 reads, “We are all like an unclean thing, and all our righteousnesses are like filthy rags.” This verse does not say that all our sins are like filthy rags, but that all our righteousnesses are like filthy rags. Even the best efforts we make to be religious—to please God and serve Him in our own strength—are but filthy rags. These filthy rags do not fit us for the courts of heaven. God requires that we put away those filthy rags of our own righteousness. We must cease from relying on our own good works and religious activities, acknowledging that we are sinful. We must believe that Jesus was made sin with our sinfulness on the cross so that we, in turn, might be made righteous with His righteousness.