What is the meaning of Romans 4:3-5?

3 For what saith the scripture? Abraham believed God, and it was counted unto him for righteousness. 4 Now to him that worketh is the reward not reckoned of grace, but of debt. 5 But to him that worketh not, but believeth on him that justifieth the ungodly, his faith is counted for righteousness. (Romans 4:3-5 KJV)

William Burkitt’s Commentary

Observe here, 1. The account which the scripture gives of Abraham’s justification; it was by faith alone;  He believed God and was accounted to him for righteousness: That is, he firmly believed the promise of God that he would give him a son in whom all the families of the earth should be blessed. And through his faith, he was reckoned or esteemed righteous before God, and not through his works.

Observe, 2. The apostle’s argument to prove that Abraham was justified by faith and not by works; had he works of perfect holiness, then in strict justice, a reward might have been expected by him as a due debt and not given him in a way of grace and favour. For to him that worketh, that is, with a design and intent to obtain justification by his works,  is the reward reckoned not of grace, but of debt; he having performed all that was required, in order to his being righteous before God.  But to him that worketh not; that is, who works not to the intent and end aforementioned, namely, to procure justification by working, but seeks that in a way of believing;  his faith is counted for righteousness. To him that worketh not, but believeth, &c. We must not understand it absolutely; for he that believes, works: But,  secundum quid, after a sort, he is said not to work; because he works not with a design to stand righteous before God by his works.

Again, by him that worketh not, we are not to understand an idle, lazy believer that takes no care of the duties of obedience; no, an idle faith is an ineffectual faith and can never be a saving faith: But the meaning is, he works not in a law sense to the ends and intentions of the first covenant, to make up righteousness by the law, and seeing all his endeavours to obey the law-sense not to work, because he does not work so as to answer the purpose and end of the law, which accepts of nothing short of perfect and complete obedience. And whereas it is here said,  That God justifieth the ungodly; the meaning is, such as have been ungodly, not such as continue so.

The apostle describes the temper and frame of their hearts and lives before justification, and not after it; as it found them, not as it leaves them. True, Christ justifies the ungodly, yet such as continue ungodly are not justified by him: We must bring credentials from our sanctification, to bear witness to the truth of our justification.