God did not allow David to build the temple because he had shed much blood (see 1 Kings 5:3–4). David's wars were not wrong, and God had blessed and supported them. However, the bloodshed and deaths in battle made David ceremonially unclean (see 1 Chronicles 28:3; compare Genesis 4:10–12; Leviticus 17:3–4; Deuteronomy 21:1–9; Matthew 27:24–25). Therefore, he could not build a holy sanctuary for the Lord.