For what does the Scripture say? "ABRAHAM BELIEVED GOD, AND IT WAS ACCOUNTED TO HIM FOR RIGHTEOUSNESS." (Romans 4:3)
Paul had pointed out in the previous verses that Abraham had nothing to boast about because he was not justified by “works” (sinlessness).
God did not owe Abraham justification or righteousness. Abraham had sinned, so he was unable to boast.
Abraham was unable to boast on the grounds of his works because he was a sinner. He couldn’t boast on the grounds of his faith for that conceded he was a sinner in need of charity. - McGuiggan, Romans, 140
“Abraham believed God.”
It must be noted that Abraham’s faith was not just mental assent but obedient faith. It is precisely this kind of faith that will save us today. - Wacaster, Studies in Romans, 154
Abraham did not just merely acknowledge what God said to be true - he acted upon his trust in God’s promises (Genesis 15:1-6; Hebrews 11:17-19). Sometimes mere mental acknowledgment is called “faith” in our world today - and that is nowhere near all that biblical faith is.
Just consider all the examples from Hebrews 11.
Even in believing and obeying God, it’s important to note that Abraham did not “earn” righteousness.
God “accounted” or “credited to him for righteousness.”
This word [“accounted” or “credited”] was originally a mathematical or accounting term, and it fittingly conveys Paul’s point that faith was “counted” as righteousness. - Pollard, Truth for Today Commentary, 141
While the Jews believed Abraham’s faith was a meritorious work that deserved a reward, Paul will show that not even Abraham deserved a reward.
A passage that comes to my mind when I think about obeying God and never putting God in a position where He “owes” us salvation is Luke 17:7-10.
And which of you, having a servant plowing or tending sheep, will say to him when he has come in from the field, 'Come at once and sit down to eat'? But will he not rather say to him, 'Prepare something for my supper, and gird yourself and serve me till I have eaten and drunk, and afterward you will eat and drink'? Does he thank that servant because he did the things that were commanded him? I think not. So likewise you, when you have done all those things which you are commanded, say, 'We are unprofitable servants. We have done what was our duty to do.' " (Luke 17:7-10)
Obedience to God is not something we do to try and earn our salvation or get God to “owe” us something - for the debt we owe is too great for us to repay it (Matthew 18:21-35).
Obeying God is simply the proper response of someone who desires to serve God for all He has done and who He is. Even after doing everything God commands, we still are “unprofitable” - we still have not placed God in our debt.
Paul is driving home the point to all of us that no one deserves to stand as “righteous” before God - for “for all have sinned and fall short of the glory of God” (Romans 3:23).