Another interpretation [of "Happy is the man"] - this refers to David, as it is written (2 Samuel 7:18), "And King David came and sat before the Lord." And so Rabbi Chiya taught: "There is no sitting in the Temple courtyard except for the kings of the Davidic dynasty." And Rabbi Ami said in the name of Reish Lakish: "There is no sitting in the Temple courtyard except in the place designated for the kings of the Davidic dynasty."
And it is written (2 Samuel 7:18), "And David sat." But not so said Rav Huna in the name of Rabbi Yishmael: "There is no sitting above [in heaven], as it is stated (Daniel 7:10), 'A fiery stream issued and came forth from before him: thousand thousands ministered to him, and ten thousand times ten thousand stood before him.' They do not have the ability to leap. As it is said (Ezekiel 1:7), "Their legs were straight legs."
And it is written (Isaiah 6:2), "Seraphs stood above him." And it is written (Zechariah 3:7), "I will grant you walking among those who stand here." Above there is no sitting, but David sits. Rabbi Ami said, "Even the kings of the house of David have no sitting."
And what is "and he sat who relied on himself"? And to whom does the sitting belong? You should say to the high priest, as it is said (1 Samuel 1:9), "And Eli the priest sat upon a seat." If so, what is "and he sat before the Lord," that he sat himself in prayer?
There we learn that the prohibitions of the Ammonites and Moabites are an eternal prohibition, but their women are permitted immediately. (2 Samuel 7:18), "Who am I, and who is my household, that you have brought me this far?" What is "this far"? It is not enough that I came to the congregation, but that I became king. And "this far" refers only to a king, as it is said (1 Samuel 10:24), "Behold the king comes." (2 Samuel 7:19), "And this is the law of man."
This is what you wrote in your Torah, "An Ammonite or Moabite shall not enter into the congregation of the Lord" (Deuteronomy 23:4). You wrote only about the man, but their women are permitted immediately. And the Torah of Abraham, Isaac, and Jacob is not written here, but the Torah of man. And who is the most praiseworthy among the prophets and the most praiseworthy among the kings?
The most praiseworthy among the prophets is Moses. The most praiseworthy among the kings is David. You find that everything Moses did, David did. Moses brought Israel out of Egypt, and David brought Israel out of the bondage of kingdoms.
Moses fought wars against Sihon and Og, and David fought the wars of the Lord, as it is said (1 Samuel 25:28), "For the wars of the Lord, my lord fights." Moses ruled over Israel and Judah, as it is said (Deuteronomy 33:5), 'He was king in Jeshurun.' And David ruled over Israel and Judah. Moses parted the sea for them, and David parted the rivers for them, as it is said (Psalm 78:13), 'He divided the sea and made them pass through, and he made the waters stand like a heap.'
Moses built an altar, and David built an altar. This one sacrificed, and that one sacrificed. Moses gave them the five books of the Torah, and in exchange, David gave them the Book of Psalms, which contains five books: 'Happy is the man,' 'To the conductor,' 'A psalm of Asaph,' 'A prayer of Moses,' and 'Let my Redeemer say.' Moses blessed Israel with 'Happy are you,' and David blessed with 'Happy is he' (Proverbs 8:8), 'All the words of my mouth are with righteousness; nothing crooked or twisted is in them.'
We find that the Torah used euphemisms for unclean animals, saying 'from the animal that is pure and from the animal that is impure' (Genesis 7:8), and Rabbi Yudan said in the name of Rabbi Menashe: 'Even when it comes to opening up topics of purity, it says about the camel, 'because it does not chew the cud,' and not 'because it is unclean,' and about the pig, 'because it has a split hoof,' and not 'because it is unclean.'
David also testified about himself and said (1 Samuel 13:14), 'The Lord has sought for Himself a man after His own heart,' and he called his Creator 'his Maker.' Just as His Maker does not utter anything unseemly, so David also did not utter anything unseemly. He could have said, 'Cursed is the man who walks in the counsel of the wicked,' or 'Blessed is the man who walks in the counsel of the righteous.'"