Why didn’t David Hamelech merit to fulfill his life dream of building the Beit Hamikdash? The most accepted answer is that as one who took part in wars and spilled the blood of Hashem’s enemies, he was precluded from building the house that symbolizes peace. We will try to evaluate this answer in light of rulings of the Rambam and in light ofp’sukim from this week’s parasha.
The Amora Shmuel said: "There is nothing between this world and the days of Mashiach but the enslavement to the kingdoms" (Berachot 34b). The Rambam (Commentary on the Mishna, introduction to the lastperek of Sanhedrin) accepts this approach. Any reasonable person will understand that one cannot have a Kingdom of Israel without assembling a military force, which is also needed to stop the subjugation of other forces and protect the people at the time ofMashiach. Since the nations will still be interested in destroying us, we will have no choice but to use this force.
This idea is all the clearer when looking at the way the Rambam comments on Bilam’s final prophecy (Bamidbar 24:14-19). "… I will advise you what this nation [Israel] will do to your nation at the end of days. … a tribe in Israel will arise and destroy the leaders of Moav and penetrate the Children of Seth. Edom will be conquered …" The Rambam (Melachim 11:1) explains as follows: "The King Mashiach will arise and return the Kingdom of David to its former Kingdom and build the Mikdash and gather the scattered of Israel, and all matters of justice will return to their previous state… these are all matters that are stated explicitly by the Torah and include everything that the Prophets wrote. These things were even mentioned in the section on Bilam, in which he prophesied about two Mashiachs. One is the first Mashiach, i.e., David, who saved Israel from their enemies, and there is also a last Mashiach, who will emanate from [David’s] offspring and will save Israel from the sons of Eisav." The Rambam continues by going through the parallel sections of the poetic description of the future events from our parasha. The first segment of each pasuk refers to David, and the second segment refers to the future Mashiach, pasuk after pasuk.
According to this, Mashiach is the "twin" of David. Thus, just as David assembled an army and took part successfully in battle, so too will Mashiach, even though we are told that it will be Mashiach who builds the final Beit Hamikdash. There is no contradiction between having an army and building a Beit Hamikdash. Thus, David could have been able to build the Mikdash despite his battles. At some future day, we will explain the p’sukim in Divrei Hayamim (I:22:8) that seem to say that it was the blood that David spilled that disqualified him.
Today as well, Hesder students combine the study of Torah with significant service in the IDF. They are, in that way, like the warriors of David, who sanctify Hashem’s name by taking part in Israel’s wars. May they and the rest of us merit seeing the building of the Beit Hamikdash.