"Take vengeance for the Children of Israel against the Midianites; afterwards you will be gathered unto your people," said Hashem to Moshe. Gather armed men from among you to form an army, and let them fight Midian, Moshe said to the people. (31:1-2) Rashi quotes Sifri to say that "Moshe performed the Mitzvah with joy and without delay, even though he knew that his passing was directly tied to destroying the Midianites."
Moshe had the option to postpone the conflict and prolong his own life, even though Rashi states that Moshe's death was directly related to the military war, despite his extraordinary clarity in comprehending Hashem's purpose. However, he led by example, clearing his heart of all personal grievances and guiding the crowd in total submission to Hashem's purpose.
There is a problem with this view, though. The Torah says, "Send men for yourself, as spies," at the beginning of Parshas Shelach, when the Meraglim/spies episode is taking place. The term "for yourself" indicates that Moshe felt it was in his own best interest to send the spies in order to delay the Jewish people's entry into the Land and therefore prolong his own life, according to the Ohr HaChaim HaKadosh! (Moshe would have had to perish at the entrance of Klal Yisroel, since he was not allowed to enter the Land.) Actually, Moshe lived for an additional thirty-nine years. Why, in contrast to the revenge against the Midianites, did Hashem permit Moshe's life to be prolonged during the spies' incident? The reason is that Moshe's guidance, clout, and unceasing Torah transmission benefitted the Jews immensely during the next thirty-nine years. Yehoshua had been designated as Moshe's heir by the time of the Midianite War. There was no particular need to keep Moshe alive for the good of Klal Yisrael because a new leader had taken over. Thus, as Rashi teaches, Moshe joyously and quickly accepted Hashem's will when the time arrived for him to enter the Olam HaEmes.
With this insight we can answer a question asked: Why does the Torah use the term x ©g ©` and not x ©g ©` §e? The answer is simple: Since there was a connection of taking revenge and afterwards Moshe would have to pass on, therefore, the Torah stipulates the word x ©g ©` to stress this point. (Yehuda Z. Klitnick)
Moav was spared because of Hakaras Hatov to them.
Many scholars ask, given the depravity they caused, why Hashem did not command Moshe to execute revenge on Moav rather than on Midian. The Yalkut responds that Hashem spared Moav because Moshe Rabbeinu was to be buried within Moav's borders. With the help of this pshat, we can conclude that this idea is expressed in this posuk, seemingly saying: Take vengeance on the Midianites on behalf of Israel. Why not take Moav on? The answer is ..
And He buried him in the valley, in the land of Moav, opposite Beth Pe'or. And no person knows the place of his burial, unto this day. (Devarim 34:6). Thus, refrain from exacting revenge on Moav. This serves as a Hakaras Hatov lesson. Moav saved himself from vengeance by allowing Moshe a place to be buried.
(Iyun Yaakov Reb Yaakov Reisher)
