"The Lord spoke to Moses, saying, 2 “Avenge the people of Israel on the Midianites. Afterward you shall be gathered to your people.” 3 So Moses spoke to the people, saying, “Arm men from among you for the war, that they may go against Midian to execute the Lord's vengeance on Midian. 4 You shall send a thousand from each of the tribes of Israel to the war.” 5 So there were provided, out of the thousands of Israel, a thousand from each tribe, twelve thousand armed for war. 6 And Moses sent them to the war, a thousand from each tribe, together with Phinehas the son of Eleazar the priest, with the vessels of the sanctuary and the trumpets for the alarm in his hand. 7 They warred against Midian, as the Lord commanded Moses, and killed every male. 8 They killed the kings of Midian with the rest of their slain, Evi, Rekem, Zur, Hur, and Reba, the five kings of Midian. And they also killed Balaam the son of Beor with the sword. 9 And the people of Israel took captive the women of Midian and their little ones, and they took as plunder all their cattle, their flocks, and all their goods. 10 All their cities in the places where they lived, and all their encampments, they burned with fire, 11 and took all the spoil and all the plunder, both of man and of beast. 12 Then they brought the captives and the plunder and the spoil to Moses, and to Eleazar the priest, and to the congregation of the people of Israel, at the camp on the plains of Moab by the Jordan at Jericho."
Numbers 31:1-12
The war against the Midianites is clearly meant to be understood as a holy war, that is to say, it was a war ordained by God to be a judgment and punishment because of Midian's sins. This is the only thing that will help us to see meaning and significance in what is undoubtedly a chapter that presents moral difficulties to our minds.
Moses is commanded by God to avenge Israel on Midian (2). We need to recall in this connection the incident mentioned in 25:17, in the story of Balaam (significantly, Balaam was killed in the battle). A small army is selected to go out against Midian, and devastates it, slays its five kings (8) and takes an enormous amount of booty (concerning the apportionment of which a good part of the rest of the chapter is occupied). On their return with the booty, Moses expostulates angrily (14,15) at the sight of the women they had taken captive, and commands that all save those that were innocent girls, be slain, including the male children. And this is done. It is this last particularly that raises questions of concern in our minds, and it would not be honest or honourable to pass these by without trying to say something about them.