Moses sent them to the war...
G-d charged Moses with the mission, yet he sends others! But since Moses had grown up in the land of Midian, he thought: It is not right that I should punish one who has done good to me. The proverb says: "A well from which you drank, cast not a stone into it."
They warred against Midian, as G-d commanded Moses
When laying siege on a city to conquer it, we do not surround it from all four sides, but only from three sides, leaving a way to escape for anyone who wishes to flee for his life. As it is written, "they warred against Midian, as G-d commanded Moses"; it has been handed down by tradition that this is what G-d had commanded him.