Why did God say that David couldn't build God's house?


Because David had shed too much blood in his sight.

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. 1 Chronicles 22:8

God said unto me, Thou shalt not build an house for my name, because thou hast been a man of war, and hast shed blood. 1 Chronicles 28:3