מִצְוָה לְהַתְקִין מָקוֹם לְהִפָּנוֹת בּוֹ – שֶׁנִּצְטַוִּינוּ כְּשֶׁיֵּצְאוּ חֵילוֹתֵינוּ לַמִּלְחָמָה, שֶׁנָּכִין וּנְיַחֵד לַחַיִל מָקוֹם יָדוּעַ (עי' תוספתא מגילה פ"ג הט"ו), שֶׁיִּהְיֶה שָׁם כָּל אִישׁ יוֹצֵא לַעֲשׂוֹת צְרָכָיו, כְּדֵי שֶׁלֹּא יַעֲשׂוּ צָרְכֵיהֶם בְּכָל מָקוֹם וּבֵינוֹת הַמְּלוֹנוֹת, כְּמוֹ שֶׁיַּעֲשׂוּ הָאֻמּוֹת (סנהדרין קד ב), וְעַל זֶה נֶאֱמַר (דברים כג יג) וְיָד תִּהְיֶה לְךָ מִחוּץ לַמַּחֲנֶה וְגוֹ', וּלְשׁוֹן סִפְרֵי, אֵין יָד אֶלָּא מָקוֹם, שֶׁנֶּאֱמַר (שמואל א טו, יב) וְהִנֵּה מַצִּיב לוֹ יָד. The commandment to set up a place in which to defecate: That we were commanded that when our soldiers go out to war that we set up and designate a set place (see Tosefta Megillah 3:15) for the soldier, in which every man can go out to take care of his needs; so that their “needs” not be [found] in every place and between the lodgings, like the [other] peoples do (Sanhedrin 104b). And about this it is stated (Deuteronomy 23:13), “And there shall be a yad for you outside the camp, etc.” And the language of Sifrei is “A yad is always a place, as it states (I Samuel 15:12), ‘and behold, he established a yad.’”
מִשָּׁרְשֵׁי הַמִּצְוָה. כְּעִנְיָן שֶׁכָּתוּב בַּפָּרָשָׁה כִּי יְיָ אֱלֹהֶיךָ מִתְהַלֵּךְ בְּקֶרֶב מַחֲנֶךָ וְהָיָה מַחֲנֶךָ קָדוֹשׁ וְגוֹ', כְּלוֹמַר שֶׁנַּפְשׁוֹתָן שֶׁל יִשְׂרָאֵל דְּבֵקוֹת בַּשְּׁכִינָה לְעוֹלָם, וְכָל שֶׁכֵּן בַּמַּחֲנֶה שֶׁכֻּלָּן נְקִיֵּי הַנֶּפֶשׁ, כִּי כָּל הַיָּרֵא מֵעֲבֵרוֹת שֶׁבְּיָדוֹ כְּבָר הָלַךְ לוֹ וְשָׁב אֶל הַבַּיִת, וְנִשְׁאֲרוּ הַטּוֹבִים אֲשֶׁר רוּחַ אֱלֹהִים שׁוֹכֵן בְּתוֹכָם, וְרָאוּי לָהֶם לַעֲמֹד בִּנְקִיּוּת, כַּאֲשֶׁר יָדוּעַ וּמְפֻרְסָם, שֶׁהַנְּקִיּוּת מִדָּה מִן הַמִּדּוֹת הַטּוֹבוֹת הַמְּבִיאָה לִידֵי רוּחַ הַקֹּדֶשׁ, וְכִדְדָרַשׁ רַבִּי פִּנְחָס בֶּן יָאִיר בְּפֶרֶק קַמָּא דַּעֲבוֹדָה זָרָה (כ, ב), וְגַם יֵשׁ בָּזֶה שֶׁבַח לָאֻמָּה כִּי יָבוֹאוּ אֲלֵיהֶם מַלְאֲכֵי גּוֹי וְיִרְאוּ מַחֲנֵיהֶם קָדוֹשׁ וְנָקִי מִכָּל טִנּוּף (עי' מו"נ ח"ג פמ"ח). It is from the roots of the commandment [that it is] like the matter that is written in the section of the Torah [wherein this is mentioned), “Since the Lord, your God, moves about in your camp [...], let your camp be holy” which is to say that the souls of Israel always cling to the Divine presence. And all the more so are all of them of clean souls in the camp; since anyone who was fearful from the sins in his hand already left and went back to his home, and there [only] remained the good ones — in which the spirit of God dwells among them. And it is fitting for them to stand in cleanliness, as is known and famous — since cleanliness is from the good traits that bring the holy spirit, and like the homily of Rabbi Pinchas ben Yair in the first chapter of Avodah Zarah 20b. And there is also praise to the people in this, when gentile messengers come and see that their camp is holy and clean from all filth. (See Guide for the Perplexed 3:48.)
דִּינֵי הַמִּצְוָה. כְּלוּלִים בִּפְשַׁט הַכָּתוּב. The laws of the commandment are included in the simple meaning of the verse.
וְנוֹהֶגֶת בִּזְמַן הַבַּיִת בִּזְכָרִים, כִּי הֵם הַנִּלְחָמִים, לֹא הַנְּקֵבוֹת. וְהָעוֹבֵר עַל זֶה וְלֹא הִתְקִין לוֹ מָקוֹם מִחוּץ לַמַּחֲנֶה וְלִכְלֵךְ מְקוֹם הַמַּחֲנוֹת בִּטֵּל עֲשֵׂה זֶה, וְעָנְשׁוֹ גָּדוֹל מְאֹד שֶׁגּוֹרֵם לַשְּׁכִינָה לְהִסְתַּלֵּק מִמַּחֲנֵה יִשְׂרָאֵל, וּכְמוֹ שֶׁכָּתוּב וְלֹא יִרְאֶה בְךָ עֶרְוַת דָּבָר וְשָׁב מֵאַחֲרֶיךָ, כְּלוֹמַר, בִּהְיוֹתְכֶם בְּתוֹךְ הַלִּכְלוּךְ תַּרְחִיקוּ עַצְמְכֶם מִן הַטּוֹב. And it is observed at the time of the Temple by males, since they are the fighters, not the females. And one who transgresses it, and does not set up a place for himself outside of the camp and dirties the place of the camps, violates this positive commandment. And his punishment is very great, since he caused the Divine Presence to withdraw from the camp of Israel. And [it is] like it is written, “let Him not find anything unseemly among you and turn away from you” — which is to say that, in your being among dirt, you will distance yourself from the good.