“Or do you not know that wrongdoers will not inherit the kingdom of God? Do not be deceived: Neither the sexually immoral nor idolaters nor adulterers nor men who have sex with men nor thieves nor the greedy nor drunkards nor slanderers nor swindlers will inherit the kingdom of God. And that is what some of you were. But you were washed, you were sanctified, you were justified in the name of the Lord Jesus Christ and by the Spirit of our God.” (1 Cor. 6:9-11 NIV)
What is justified?
Answer Simply put, to justify is to declare righteous. Justification is an act of God whereby He pronounces a sinner to be righteous because of that sinner's faith in Christ.
In the passage above is a list of those who will not inherit the kingdom of God because of their sinfulness, which separates them from God. But that passage goes on to proclaim something truly remarkable, that some of them who placed their faith in the Name of Jesus Christ were justified (made righteous).
Salvation is often viewed in legal terms
Justification is a legal term with a meaning like “acquittal”; in religion it points to the process whereby a person is declared to be right before God. That person should be an upright and good person, but justification does not point to qualities like these. That is rather the content of sanctification. Justification points to the acquittal of one who is tried before God. In both the Old Testament and the New the question receives a good deal of attention and in both it is clear that people cannot bring about their justification by their own efforts. The legal force of the terminology is clear when Job exclaims, “Now that I have prepared my case, I know I will be vindicated.” (Job 13:18 )
Believers are justified freely by faith in Jesus
“But now apart from the law the righteousness of God has been made known, to which the Law and the Prophets testify. This righteousness is given through faith in Jesus Christ to all who believe.There is no difference between Jew and Gentile, for all have sinned and fall short of the glory of God, and all are justified freely by his grace through the redemption that came by Christ Jesus. God presented Christ as a sacrifice of atonement, through the shedding of his blood—to be received by faith. He did this to demonstrate his righteousness, because in his forbearance he had left the sins committed beforehand unpunished— he did it to demonstrate his righteousness at the present time, so as to be just and the one who justifies those who have faith in Jesus.” (Rom. 3:21-26 NIV)
Therefore
“Just-as-if-I’d never sinned” is one way the word justified has been explained. God not only forgives us, but He sees us as if we had never sinned. He removes our sin, and in its position He places the perfect righteousness of Christ.
“He made Him who knew no sin to be sin on our behalf, so that we might become the righteousness of God in Him.” (2 Cor. 5:21)