Romans / Question
Romans 4:5 says God justifies the ungodly, which means justification is grace for people who cannot present a worthy record. Paul contrasts wages earned by work with righteousness counted to the one who trusts God.
Paul is explaining Abraham's faith and then widening the point. If righteousness were earned, it would be a wage. Instead, God counts righteousness to the person who trusts him.
This protects the scandal and comfort of grace. Romans says God does not wait for sinners to become impressive before justifying them.
A careful reading should not treat this verse to make sin harmless. Romans 6 will reject continuing in sin. Romans 4 explains the basis of justification, not permission to remain unchanged.