David receives God's great kindness and special salvation as a direct reward for always choosing to walk in His ways. Because of this steady dedication, God repays him accordingly [מצודת דוד, ביאור שטיינזלץ].
This faithfulness is defined by a deep sense of personal purity [ביאור שטיינזלץ]. Crucially, this purity is maintained directly before God's eyes. It represents a genuine, internal righteousness directed entirely toward heaven. It is never an act designed to show off or win the approval of other people, but rather a sincere devotion witnessed by God alone [מצודת דוד].