This psalm (Psalm 51) is commonly called a “penitential psalm,” and among them all it is the most widely used in church and daily prayers. Whoever first gave it this name, knew what he was doing. … They [Luther’s Roman opponents] have applied this psalm to the penance of works, to actual sin, which they define as “anything said, done, or thought against the Law of God.” This definition is far too narrow to portray the greatness or power of sin. We must look at sin more deeply and show more clearly the root of wickedness or sin, not simply remain with the “elicited acts,” as they call them. From this error, their failure to understand sin properly, there comes, of course, the other error, their failure to understand the nature of grace properly either. … How can anyone give consolation if he does not understand what grace is? …
The reading of this psalm will be especially useful in teaching us to understand these points of our doctrine properly …
Here the doctrine of true repentance is set forth before us. There are two elements in true repentance: recognition of sin and recognition of grace; or, to use the more familiar terms, the fear of God and trust in mercy.
Martin Luther commenting on Psalm 51
Luther’s Works v. 12: Selection from the Psalms 304, 305