Psalms - Chapter 24
This Psalm begins, "Of David, a song," rather than the more familiar "A song of David." The difference between these two, according to the Talmud in Pesachim (117a) is that "A song of David" was said when David sang, causing G-d's spirit to rest upon him. "Of David, a song" was said when G-d's spirit rested upon him, causing him to sing.
Everything in the world belongs to G-d. He spread out the land upon which we live. Who can climb the Temple mount and stand in His Sanctuary? Only one with pure hands and heart, who has not sworn falsely or in vain. This person will be blessed by G-d and he and others like him will constitute a generation that seeks G-d.
David composed this Psalm when he purchased the Temple mount (II Samuel 24) to be sung at the Temple dedication. At this point, he addresses the gates of the Temple, telling them to open up in order to receive G-d, who is the King of Glory, a mighty warrior in battle, and L-rd of the legions of Israel. (The Talmud in Shabbos, 30a, describes Solomon's dedication of the Temple and applies these verses there.)
The Talmud in Brachos (35a-b) contrasts the verse "The world and its contents belong to G-d" (24:1) with "The Heavens are G-d's, but the Earth He has given to humans" (115:16). They conclude that before we make blessings on food, it belongs to G-d and to eat it would be stealing from Him; after we recite a blessing, He has given the food to us and we may partake of it.
This familiar Psalm is recited when the Torah is returned to the Ark (except on Shabbos mornings) and it is the Psalm of the day for Sunday.