רמב"ן
Ramban on Numbers 31:2
Q — Moshe rages at the officers who returned from Midian with women alive. But he never said 'kill the women' — just 'to take Hashem's vengeance.' Why be angry at compliance?
A — Ramban: Moshe expected the officers to exercise judgment, not literalism. They should have inferred two things. (1) Moral-historical: 'הן הנה היו לבני ישראל בדבר בלעם' — these very women caused the magefa at Peor. Vengeance on Midian without killing the women who actually caused the deaths is no vengeance at all. (2) Halachic kal va'chomer: 'ואת הבהמה תהרוגו' — Torah law mandates killing an animal that caused a person to sin; surely a fortiori the human women who deliberately seduced the camp. Officers who carry out an order to the letter while ignoring its evident moral and halachic logic fail their commander. The chiddush, framed beautifully with the adjacent parsha (Nedarim): both 'I wasn't told' (the officers) and 'I was told' (the wife relying on her husband's wrongly-permitted vow) are unacceptable excuses. Judgment is required either way.
והנה משה לא צוה אותם מה יעשו, רק אמר להם 'לתת נקמת ה' במדין', וחשב שלא ישאירו בהם שריד ופליט כנקמת עמלק או כנקמת שבעה עממים. וכאשר ראה שהשאירו הנשים והטף והבהמה, קצף על הנשים היודעות משכב זכר, כי ראוי לפקודי החיל להורגן תחלת כל דבר, גם לנקמה גם לדין התורה 'ואת הבהמה תהרוגו'.