"Let the wicked be ashamed, for they have lied against me, etc." David said, "Even though the wicked may oppress me, I have not forsaken the Torah." Similarly, it is written (2 Samuel 21:22), "These four were born to the giant in Gath, etc." Even though they came upon me, I did not forsake the Torah, but rather (2 Samuel 22:1), "David spoke to the Lord the words of this song, etc." "Let those who fear You return to me and those who know Your testimonies."

"Let my heart be sincere in Your statutes, etc." A pot in which I ate non-sacred food, I did not eat sacred food in it so that I would not be embarrassed. Therefore it is said (Psalms 119:80), "My heart is breached within me." And it is written (Psalms 119:80), "Let my heart be sincere in Your statutes." And it is written (Psalms 51:12), "Create in me a pure heart, O God."

The heart is what causes a person to be ashamed of what he knows he has done and is ashamed of himself. Therefore it is said (Proverbs 14:10), "The heart knows its own bitterness, and a stranger does not share its joy." And the heart is what brings joy. And so David said, "Let my heart be sincere in Your statutes."

And just as David asked for it, so did the Lord give him, as it is said (2 Samuel 22:36), "And You have given me Your shield of salvation, etc." Therefore it is said, "So that I will not be ashamed."