Create in me a pure heart, O God,
and renew a steadfast spirit within me.
When we have been in sin, it leaves us with an unclean feeling. Even though we have been washed by the blood of Christ, our hearts many times still feel unworthy to be in the presence of God... Unworthy to pray or to think righteous thoughts. We get the sense that we have blown it for good.
But God wants to create in us again a pure heart. I don't think that this verse is teaching us a doctrine of salvation, I think that David is expressing what he knows that he needs: a pure heart. A heart that is clean.
He doesn't want to be floating around in the middle anymore. He wants a heart that is back where it used to be, and he wants it to stay there.
A heart that is pure and a spirit that is steadfast.