David held a deep desire to construct the permanent sanctuary for God, yet he was ultimately held back from fulfilling this dream. He openly shares the core reason for this restriction, explaining that God directly disqualified him due to his extensive military background.
The logic behind this divine decision is rooted in a broader principle regarding sacred spaces [מצודת דוד]. There is a strict rule against using iron tools to shape the stones of the Altar. Because iron is the material used to create weapons of murder, it is entirely unfit for building a place of worship. In the exact same way that iron is banned from the Altar due to its connection to violence, a person who has spent his life engaged in warfare and shedding blood cannot build the House of God.