The milchemet mitzvah of the Jewish People is not like the wars of the gentiles. Rather, its conception and birth are in holiness. Following is Rambam (Hilchot Melachim 7:1): In both compulsory and noncompulsory war, a Kohen is appointed to address the nation during the war and he is anointed with the anointing oil. He is the one called the mashuach milchamah, the “anointed for war”. Israel goes into battle behind the anointed of war. He defines and determines the nature of the war, sanctifies it through his words to the people and makes certain that Israel go to war in holiness and with trust in G-d. Such is Jewish warfare! It is based on holiness, on faith and trust in G-d that if someone fights the wars of G-d, evil will not befall him since he is fighting for the sanctification of G-d's name.
The phrase “to save you and grant you victory over your enemies” means as follows: First G-d will save you from yourselves, by warning you about everything evil so that you will be holy. Only then will He grant you victory, saving you from them. Sifri (258) comments, “If you do everything stated regarding this matter, G-d will ultimately save you and grant you victory over your enemies.” The Jewish war camp must be holy, as is fitting for a war over the sanctification of G-d's name. Nothing inflames the passions more than war, when acts generally forbidden become permissible. Given such license, the evil impulse attempts to take control of a person, and no temptation is more powerful than the sexual impulse. If women were allowed to be part of a military camp during wartime, the sins incurred would outweigh the merit earned for a milchemet mitzvah. There would be no avoiding licentiousness and promiscuity (as in the modern Israeli army camp, Heaven help us, when the Jewish state has not adopted Jewish laws of warfare). The army camp would, thus, be transformed from a holy camp, free of impurity and abomination (see Sforno, Ibid.) to a licentious camp. If it became so, a war meant to sanctify G-d's name would become a stage for sexual sin, the height of profanation of G-d's name. Therefore, a woman should not go to war with men. Ramban explains: Scripture warns against sin where sin is most prevalent. It is known that soldiers going to war customarily consume every abomination, rob and steal, and are unashamed to commit adultery and every other outrage. The most upright person, by nature, becomes cruel and vicious when the camp goes forth against the enemy. Scripture therefore warned, “You must avoid everything evil” (Deut. 23:10). Sifri (Ibid.) comments, “This teaches that sexual sin causes the Divine Presence to withdraw.” Thus, sexual sin endangers the troops, for without the Divine Presence there will be no victory. The Torah, therefore, forbade women going to war with men, even in a milchemet mitzvah, so as not to turn the mitzvah into a sin.
A Talmid Chacham does not go off to war either, even for a milchemet mitzvah. R. Elazar said (Nedarim 32a): Why was Abraham punished such that his descendants were enslaved to the Egyptians for 210 years? It is because he conscripted Talmidei Chachamim; “Abraham called his students [to battle].” (Gen. 14:14). We must be aware that “Talmid Chacham” refers only to someone whose Torah study is his sole occupation, someone totally absorbed in Torah study day and night, who never leaves it for anything in the world, a person who together with his study is crucial to his generation.
There are two types of Talmidei Chachamim. The first is the one whose Torah study is his sole occupation. This individual is totally immersed in constant Torah study. Such a Talmid Chacham does not cease Torah study even to fulfill time-bound positive precepts incumbent on him personally,, if they are of Rabbinic origin, for example, the Shemoneh Esreh according to most opinions. He ceases only for precepts of Torah origin, such as the Shema. The other Talmid Chacham, the one whose Torah study is not his sole occupation, must cease study for every time-bound positive precept incumbent on him personally, even those Rabbinic in origin. Likewise, he must cease study even to do a mitzvah not specifically incumbent on him personally, i.e., a mitzvah of the community. Milchemet mitzvah is a communal mitzvah upon which the future of the Jewish People depends. It follows that any Talmid Chacham whose Torah study is not his sole occupation, who does not sit day and night studying Torah without earning any living or taking any vacation, will be obligated to stop studying so as to involve himself in milchemet mitzvah. Obviously, he should do this specifically in the “holy camp” framework, lest he fall prey to sin and abomination. Only the true Talmid Chacham, whose Torah study is his sole occupation, will be exempt from taking part in this mitzvah, because it can be performed by others. Yet listen to this, dear friends, and remember it: Not everyone who wishes to claim such a title may do so. If someone cloaks himself in the mantle of a Talmid Chacham whose Torah study is his sole occupation when he is unworthy of this, only to shirk the mitzvah of going to war, sanctifying G-d's name, taking G-d's revenge and assisting Israel against the attacking foe, he is a shedder of blood and his sin is unbearable. As Rambam said regarding the person commanded to fight (Hilchot Melachim 7:15); “If he does not strive to be victorious and does not fight with all his heart and soul, it is as though he has shed everyone's blood.” What shall we say about him who was obligated to fight and did not fight at all?
When it comes to the enemies of Israel who attack and beleaguer us and desire to destroy us, we are certainly required to smite them until they are consumed. It is a mitzvah – a milchemet mitzvah. The law states clearly that “assisting Israel against the attacking foe”, which constitutes a milchemet mitzvah, refers not just to an enemy who attacks with intent to annihilate Jews, but to every attempt to hurt or plunder as well, even just theft. Obviously, it includes a situation where non-Jews demand a portion of the Land of Israel, for there is an outright prohibition against giving part of the Land to a non-Jew, as we shall see. Eruvin 45 teaches: “In a border town, even where the non-Jews are not attacking to kill Jews but just demanding hay and straw, we go forth armed to attack them, even violating the Sabbath to do so”. Rashi comments: “Lest they capture it, making the rest of the Land easier for them to capture.” Rashi's point is that for this reason we go forth even on the Sabbath. Yet, regarding the actual law of assisting against an attacking foe, surely, the very fact that non-Jews are demanding even just hay and straw or money and taxes is enough reason to attack them, and that is a milchemet mitzvah. Likewise, it is clearly forbidden by a grave Torah prohibition to let a non-Jew steal even the smallest part of the Land of Israel. After all, there is a prohibition forbidding us even to diminish the spiritually pure area of the Land of Israel (Moed Kattan 5b): “We do not put a marker marking a spiritually impure area far from that area, so as not to lose part of the Land of Israel.” Due to our sins, the reason we were exiled from our land, the laws of war have been so corrupted and confused by so many fine students that ignorance on this matter has surpassed all limits. Some have no understanding whatsoever of what a milchemet mitzvah is, and in their blindness ask whether the war between us and the Arabs today is such a war. Woe to the ears that hear this! It is a great mitzvah to hate evil and evildoers, and even to wage war against them, it is an even greater mitzvah to love goodness and the righteous, i.e., those whom G-d has defined as good and righteous. The mitzvah to love one's fellow Jew, one of the Torah's foundations, dictates that a Jew must save the life of every other Jew who is in danger. This is a mitzvah incumbent on an individual, and how much more so regarding the community. It is part of “Love your neighbor as yourself” (Lev. 19:18), yet it also stands independently (Ibid., v. 16): “Do not stand still when your neighbor's life is in danger.”