knowing that a man is not justified by the works of the Law but through faith in Christ Jesus, even we have believed in Christ Jesus, so that we may be justified by faith in Christ and not by the works of the Law; since by the works of the Law no flesh will be justified.
For by grace you have been saved through faith; and that not of yourselves, it is the gift of God; not as a result of works, so that no one may boast.
for it is not the hearers of the Law who are just before God, but the doers of the Law will be justified.
You see that a man is justified by works and not by faith alone.
Contradictions! The Bible is full of them. How are we to make sense of this? Let’s ask Dr. Luther:
Here [in Romans 3:1–20] the question arises: How can a person be justified without the works of the Law, or how can it be that justification does not flow from our works? For St. James writes: “We see how that by works a man is justified, and and not by faith only” (Jas. 2:24). So also St. Paul: “Faith . . . worketh by love” (Gal. 5:6); and: “The doers of the law shall be justified” (Rom. 2:13). To this we reply: as the Apostle distinguishes between the law and faith, the letter and grace, so also he distinguishes between the works resulting from these. He calls those deeds “works of the Law” that are done without faith and divine grace, merely because of the law, moved by either fear of punishment or the alluring hope of reward. By works of faith he calls those deeds which are done in the spirit of (Christian) liberty and flow from love to God. These can be done only by such as are justified by faith. Justification, however, is not in any way promoted by the works of the Law, but they rather hinder it, because they keep a person from regarding himself as unrighteous and so in need of justification. When James and Paul say that a man is justified by works, they argue against the false opinion of those who think that (for justification) a faith suffices that is without works. Paul does not say that true faith exists without its proper works, for without these there is not true faith. But what he says is that it is faith alone that justifies, regardless of works. Justification therefore does not presuppose the works of the law, but rather a living faith which performs its proper works, as we read Galatians 5:67.
By the law is the knowledge of sin (3:20). Such knowledge of sin is obtained in two ways. First, by meditation (of the Law), as we read in Romans 7:7: “I had not know lust except the law had said, thou shalt not covet.” Secondly, by experience, namely, by trying to fulfill the Law, or we may say, through the Law as was assure to fulfill its obligations. Then the Law will become to us as occasion to sin, for then the perverted will of man, inclined to evil, but urged by the Law to do good, becomes all the more unwillingly and disinclined to do what is good. It hates to be drawn away from what it loves; and what it loves is sin, as we learn from Geneses 8:21. But just so, man, forced by the Law and obeying it unwillingly, sees how deeply sin and evil are rooted in his soul. He would never notice this, if he did not have the Law and would not try to follow it. The Apostle here only mentions this though, since he intends to treat it more fully in Chapters 5 and 7. Here he merely meets the objection that the Law would be useless if its works could not justify.
—Martin Luther, Luther’s Commentary on Romans, trans. J. Theodore Mueller (Grand Rapids, Zondervan, 1954), 59–60.