The background to the psalm is David’s desire to build a house for the Lord, which we can read about in 2 Samuel 6 and 7. The ark of the covenant, which symbolised the presence of God with his people, had not been located in a suitable place for a long time, therefore David resolved to build such a house for it. We know that God did not allow David to do so. Nevertheless his desire was commendable and God-honouring. We should honour believers that attempt things for God’s glory even if their aim is not realised (vv. 1-6).
Solomon completed the house for the Lord and the ark was brought into it (vv. 7-10). It was a time of great rejoicing and the people worshipped their God who now dwelt among them in a symbolic way. Yet as the people worship, they desire that what was symbolised would become reality. In verse 7, they realised that the proper response in the presence of God is worship that recognises he is a king (they are at his footstool). In verse 8, they want the Lord to remain with them (the idea of a resting-place does not suggest that he is tired, but that he is content). Verse 9 indicates that the worshipping priests, who wore white clothes, should have the righteousness that these clothes pictured, and the rest of the worshippers should offer joyful praise.
What made the temple of Solomon glorious was not its vast size or its ornate structure. Rather, it was glorious because the Lord dwelt in it and was worshipped there by his adoring people. A big building without God is only a pile of stones built in a particular way. In order for worship to take place there must be the presence of God and obedient worshippers.
The second section of the psalm concerns almost the opposite of the first section. In the first section, David had been concerned about building a house for the Lord; in the second section, the Lord promises to build a house for David. In verses 11 and 12, the author refers to what is called the Davidic covenant (2 Sam 7) in which the Lord promised David that one of his sons would sit on his throne, and that his line would continue as long as they were faithful to God.
While there are elements of this covenant that apply to Solomon and later kings, the main emphasis is that this is a reference to the Messiah who would come from the line of David. When we come to the New Testament we see the covenant fulfilled in Jesus. For example, there are the words of Gabriel to Mary in Luke 1:31-33: ‘And behold, you will conceive in your womb and bear a son, and you shall call his name Jesus. He will be great and will be called the Son of the Most High. And the Lord God will give to him the throne of his father David, and he will reign over the house of Jacob forever, and of his kingdom there will be no end.’ So Jesus is the fulfilment of what is promised in the psalm.