Why is the parsha of nedarim placed at the end of Sefer BaMidbar? Ramban explains that the previous parsha, which deals with the korbanos musafim of the yamim tovim, ends with a mention of nidrei gavoha, the korbanos that a person voluntarily pledges to bring (29:39). The Torah now tells us that there are additional nedarim, nidrei hedyot, that don’t pertain to korbanos and which have their own laws.
Abarbanel suggests that these last few parshiyos in BaMidbar all involve things Moshe had to do before leaving this world. Moshe was the chief justice, and in that capacity was the go-to man when people needed a neder absolved. He now had to teach the roshei ha’matos, the leaders, the halachos of nedarim to empower them to fill that role.
I would like to follow in the Abarbanels footsteps – the parsha relates to Moshe's impending exiting of the scene – but in a different way than he suggests.
In the very next parsha Moshe is given the command to take revenge on the Midyanim, “V’achar tei’asef el amecha,” after which he will die. Why did G-d include this detail? Was it a challenge to see if Moshe would fulfill the mitzvah even knowing that doing so would bring about his own end? Ksav Sofer answers that this was not the case. It was not a test, but rather an opportunity. Hashem wanted to give Moshe a chance to redeem his past sin at Mei Merivah, and in doing so, be able to die in peace. Moshe's error at Mei Merivah was in not showing empathy to Klal Yisrael. He responded to the people’s request for water with anger instead of compassion. Here, Hashem commanded, “N’kom nikmas Bnei Yisrael,” avenge the Jewish people. Show that you feel their pain at being dishonored, and in this way, undo the damage done earlier. This way you can leave the world with a clean slate.
Perhaps the parsha of nedarim is also a rectification of the Mei Merivah episode and a means of bringing closure to Moshe's past. By hitting the rock instead of speaking to it Moshe failed to teach the people the power words can have. Teaching the parsha of nedarim gave Moshe the opportunity to convey that lesson. “Lo yacheil devaro” – words cannot be treated lightly.
Later in the parsha, when the Bnei Gad and Reuvain promise that they will make pens for their sheep and cattle and build homes for their children, Moshe accepts their word, but is reiterating the promise, he reverses the order --- first, a home for the children, then a place for the sheep. Moshe concludes, “v’ha’yotzei mi’pichem ya’asu.” R’ Shaul Yisraeli writes that this is not just a warning to the Bnei Reuvain and Gad to keep their word – it’s an explanation of why the seemingly trivial detail of the order of their words mattered. What difference does it make if the Bnei Gad and Reuvain first spoke about the sheep and then their children or the other way around? Either way, they would have to take care of both? The answer is that how a person speaks influences what they do and who they are. How you put it is important because, "v’ha’yotzei mi’pichem ya’asu," a person does, acts, becomes, what comes out of their mouth.