Another thing, I am in righteousness. Since the wicked prosper in this world and deny the existence of God, while the righteous suffer in this world and die for the sake of their Creator, therefore David said "I am not among the sinners before You, but among those who toil in the Torah, as it is written 'Justice, justice, you shall pursue' " (Deuteronomy 16:20). Therefore it is said "In righteousness I will behold your face.
Another interpretation: A prayer of David. "Hear, O Lord, righteousness." This is what is written (Samuel II 22:7): "And this is to Judah; and he said, 'Hear, O Lord, the voice of Judah.'" There it is taught: "Hillel says: a filled-up amount of drawn water invalidates a mikveh, and one must express it in the language of his teacher. Shammai says: nine kavim of water invalidate it. And the Sages say: neither in accordance with the opinion of this one, nor in accordance with the opinion of that one. Until two Gardayim (dung heaps) came from the Ash heap, and bore witness from the mouth of Shemaya and Avtalyon that three Log of drawn water invalidates a mikveh, and the Sages upheld their words. Why was the place and their expertise mentioned? Is there no expertise lower than that of the Gardayim, and no more despicable place in Jerusalem than the Ash heap? Rather, it is to teach you that just as the fathers of the world did not stand by their words in a place of rumor, so too, a person should not stand by his words in a place of rumor. Why do they mention the words of Beit Shammai and Beit Hillel only to nullify them? To say to future generations that a person should not stand by his words, since the fathers of the world did not stand by their words. Why do they mention the words of an individual, since the halakha is not in accordance with him, but rather in accordance with the majority? Perhaps an individual will see the words of the court and rely on them, that a court cannot nullify the words of another court unless it is greater than it in wisdom and number. Hence, you learn that a person must rely on the words of the early sages and order his words according to the words of the Torah. And so we find in David, that he relied on the words of his teacher Moses, when he saw that he prayed for him and his tribe, and said (Samuel II 22:7): "And this is to Judah, and he said, 'Hear, O Lord, the voice of Judah.'" He began praying for himself in the same language, "Hear, O Lord, righteousness," since the voice mentioned later refers only to the voice mentioned in David's prayer, as it is written (Samuel I 26:17): "And Saul knew the voice of David."...