As we read these passages of scripture we find David weeping and crying to Yhwh for forgiveness. Calling upon the use of the Law as provided for cleansing, for sin offerings, for guilt offerings, for atonement. But the Law also required punishment for violations as in the death of adulterers, and so it seems David wanted the forgiveness provided in the Law without the penalty of the Law. As it turns out in the revelation of Yhwh through the scriptures this is, in fact, what God offers. Forgiveness and mercy for those who humbly cry out to Him. David did indeed humble himself and called for cleansing of his heart. “Restore to me the joy of my salvation and sustain me with a willing spirit.”
The pattern found in these scriptures all point to humility, confession, and crying out to the God of our salvation, and He will hear and act. Hebrews 9 tells us ” for if the blood of bulls and goats and the ashes of a heifer sprinkling those who have been defiled, sanctify for the cleansing of the flesh, then how much more will the blood of Christ, who through the eternal Spirit offered himself without blemish to God, cleanse your conscience from dead works to serve the living God.” David had the shadow we have the substance through Jesus Christ. We still serve a living God who is still in the restoration business.