ונשמרת מכל דבר רע שהשטן מקטרג בשעת הסכנה לשון רש"י והנכון בעיני בענין המצוה הזאת כי הכתוב יזהיר בעת אשר החטא מצוי בו והידוע במנהגי המחנות היוצאות למלחמה כי יאכלו כל תועבה יגזלו ויחמסו ולא יתבוששו אפילו בניאוף וכל נבלה הישר בבני אדם בטבעו יתלבש אכזריות וחמה כצאת מחנה על אויב ועל כן הזהיר בו הכתוב ונשמרת מכל דבר רע:
Keep away from every evil thing for Satan makes accusations at a time of danger. This is Rashi's explanation. But it seems correct to me that the Torah gives this warning at a time when sin is specifically prevalent. And it is known that the practices of army camps going out to war is for soldiers to eat any manner of disgusting thing, to steal, to act with violence against civilians and to have no shame, even with regards to adultery and other base actions. And the most upright and ethical person in his nature, will clothe himself in violence and rage when an army camp goes to confront its enemy and for this reason the Torah issues this command: keep away from every evil thing.
