Admit it. We all get off-track, and some of us are better at covering our tracks, but the way to get on-track is to confess, and back-track.
King David was sometimes a royal mess-up, but in the end he would always fess-up. Here he is once again, with honesty and transparency, revealing to centuries of God-followers that he took a wrong trail. At different points along the journey he got off point. Sometimes he listened to the wrong voice, often his own, and started down a path other than God's choosing.
David isn't trying to cover his tracks, he just doesn't give us a lot of detail on just how he got off-track. However, he is especially careful in explaining how he got back on-track. He says in effect, "It took a long, careful look before I got the map of my heart sorted out and reoriented to God. But when I did, and only then, I leaped to my spiritual feet and marched at God's direction, double-time."
That is important, and I will tell you why I think it is. Because once God opens our eyes enough to discover that we have lost His trail, if we will take a long and careful look, He may reveal that one wrong turn led to multiple detours. Taking the time to sort our our heart is important, because God's desire is that we take the most direct route back to Him. As God reveals those wrong turns, confess them as such, and think of each as a blaze, so we can back-track to the Main trail.