Why did God tell David he was not to build the temple?
God told David he was not to build him his temple because he had waged wars, and had killed many men. God revealed to David that his son Solomon, a man of peace, should build the temple instead.
1 Chronicles 22:5-10 KJV And David said, Solomon my son is young and tender, and the house that is to be builded for the LORD must be exceeding magnifical, of fame and of glory throughout all countries: I will therefore now make preparation for it. So David prepared abundantly before his death.
Then he called for Solomon his son, and charged him to build an house for the LORD God of Israel.
And David said to Solomon, My son, as for me, it was in my mind to build an house unto the name of the LORD my God:
But the word of the LORD came to me, saying, Thou hast shed blood abundantly, and hast made great wars: thou shalt not build an house unto my name, because thou hast shed much blood upon the earth in my sight.
Behold, a son shall be born to thee, who shall be a man of rest; and I will give him rest from all his enemies round about: for his name shall be Solomon, and I will give peace and quietness unto Israel in his days.
He shall build an house for my name; and he shall be my son, and I will be his father; and I will establish the throne of his kingdom over Israel for ever.