2 Samuel 7:8
Now therefore so shalt thou say unto my servant David, Thus saith the LORD of hosts, I took thee from the sheepcote, from following the sheep, to be ruler over my people, over Israel: Now therefore so shalt thou say unto my servant David, Thus saith the LORD of hosts, I took thee from the sheepcote, from following the sheep, to be ruler over my people, over Israel:
God took David from tending and following sheep and made him ruler over His people Israel. The reminder recalls his humble and lowly beginnings and presents his rule as God's own doing, with God's presence with him and favor toward him. It presents that rule with its great responsibilities, and his prosperity and success, as coming through God's blessing and not through any inherited goodness of his own, to be always remembered.
After that exaltation David dwelt in a palace of cedar while the ark that symbolized God remained in the curtained tabernacle where the Shekinah dwelt between the cherubim. Feeling remorse that he lived in a magnificent house while provision for God's worship was so much poorer, David made known to Nathan the prophet his purpose to build a more honorable house for God to dwell in. Nathan at first encouraged him to carry it out. God spoke these words in answering and refusing David's sincere intention to build Him a house, showing David that he had a special work of his own to perform while his son Solomon had been selected in providence to accomplish the great work of building God a house in Jerusalem.
The refusal shows that human plans are not God's plans and that God's plans for David and His cause were better. God chooses who shall build for Him and with what spirit, and may refuse even the best intentions when it is best for His cause. Even when a sincere desire is refused, God still blesses the humbly devoted person with tokens of His love and uses him in other service. So He honored David with the next highest honor of entrusting the building work to his son.