The Bible teaches that Jesus took our place on the cross. "God made Christ Who knew no sin to be sin on our behalf, that we might become the righteousness of God in Him" (2 Cor.5:21). Christ became sin for us so that we might become the righteousness of God IN HIM. This is justification, and it is a free gift of God for those who are humble enough to recognize that they can never become righteous enough to meet God's holy standards. It is by grace alone that we are justified, and as the Bible says, "If it is by grace, it is no longer on the basis of works, otherwise grace is no longer grace" (Rom.11:6). Those who seek to become righteous before God on the basis of their good works (putting the flesh to death etc.,) will fail just like Israel failed (Read Rom.9:31,32 and 10:3 carefully). Only those who seek to be justified by faith will attain to God's righteousness (Rom.9:30).
Many believers in their eagerness to get victory over sin, take a long jump from Romans 3:23 ("All have sinned and fall short of the glory of God") to Romans 6:14("Sin shall not be master over you"), bypassing the process of justification by faith described in Romans 3:24 to 5:21. As a result they become Pharisees. Two clear evidences of their Pharisaism are their pride in their own "holiness", and their despising of others who they feel are not as "holy" as they are!!
Jesus not only bore the punishment for our sins. He actually BECAME SIN. We cannot fully understand how awful an experience that was for our Lord, because we have unfortunately become as familiar with sin as a pig is with eating human dung. To understand, even faintly, the revulsion that Jesus had for sin, consider two illustrations: Think first of what it means to jump into a septic tank that is full of human dung, and to become assimilated with it permanently. Or think of what it means to voluntarily receive a dreadful, incurable disease that covers your whole body with sores from head to feet. Even those illustrations are imperfect and can give us only a faint picture of the depth of Christ's love for us, that made Him choose voluntarily to become what He hated, in order that we might become the righteousness of God in Him. Only when we see Jesus face to face will we be able to understand fully what it cost Him to save us. But even now we should be able to see something of the awfulness of sin and learn to hate it - when we see that it was our sin that crucified Christ.
Basically, there are two grounds on which Satan constantly seeks to accuse us: (1) Our past sins; and (2) Our present state. Thus he robs us of our confidence before God. But God has made provision in the gospel for a solution to both these problems.
To solve the problem of our past sins, God "justifies us through Christ's blood" (Rom.5:9). The blood of Christ cleanses us so thoroughly from our past record, that God promises not even to remember our past sins (Heb.8:12). If God remembers none of our past sins, then we can truthfully say that He looks at us just as if we had never sinned in our entire life!! The Devil will try his best to prevent you from believing this truth. If you believe Satan's lie, you will live in condemnation perpetually, and never be bold to come before God. But if you resist Satan, "through the blood of the Lamb, and the word of your testimony" concerning your being cleansed in Jesus' blood, you can be an overcomer (Rev.12:11).
To solve the problem of our present state, God places us in Christ. Nothing good dwells in our flesh. Even if we put the flesh to death for a hundred years, we will still be unfit to stand before God. This was why God forbade the Israelites from entering within the veil into the Most Holy Place of the tabernacle, where He dwelt. That veil symbolised the flesh which prevented man from coming before God's face (Heb.10:20).
God's righteousness is as high above the righteousness of the holiest man on earth, as heaven is above the earth (Isa.55:8,9).Even sinless angels cannot look at God's face, but have to cover their faces before Him (Isa.6:2,3). Only Christ can look straight into the Father's face. And so God places us in Christ, so that we can now come before Him, without any fear - because we are in Christ. God justifies us by placing us in Christ, and accepting us as being as righteous as Christ Himself. We can rejoice now in our perfect acceptance before God, because we have become the righteousness of God in Christ. The preaching of "any other gospel" that teaches acceptance before God on the basis of the works of the Law will bring the curse of God upon such a preacher (Gal.1:8). Only after perfectly justifying us, does God lead us on to sanctification - a life of victory over sin and partaking of His nature.