The message of these verses is similar to what is said in Psalm 1:2 about delighting in the law and dwelling on it day and night. David was glad that he was able to live so closely with God. David saw the altars of the Lord as the means through which to receive forgiveness for his sins. This shows that he was not being hypocritical.
6 I wash my hands in innocence and go around your altar, O LORD,