David worshipped a God who forgave sins. And the faithful love of The Lord was better than David's own spotty faithfulness to The Lord. This is why David could repent and ask for God's merciful treatment of him. David acknowledged his sins and transgressions. He appealled to the steadfast love of The Lord for God's sake, and not his own. In other words, David sought forgiveness so that God would be glorified, and not for David's own reputation.
David admitted his failings. He confessed his sin. He pleaded for God not to bring up his past sins and youthful failings. He asked for mercy so that the goodness of The Lord might be seen in him. He knew that God was loving and merciful to repentant sinners. For David to truly worship, he had to pray like a broken and repentant sinner.
I humbly learn from David's example of worship. I am also a painfully consistent sinner. I transgress God's Law. I am filled with self importance and pride. I struggle with the results of the sins of my youth. And I pray for God to forgive them in Christ and to not remember my sins. I want God's goodness to be all that is left in me for others to see. I ask, O God, for Your glory to shine through this cracked and broken sinner. May people see less of me and only You!