7 And they made war on Midian, as the Lord gave orders to Moses; and they put to death every male. 8 They put the kings of Midian to death with the rest, Evi and Reken and Zur and Hur and Reba, the five kings of Midian: and Balaam, the son of Beor, they put to death with the sword. 9 The women of Midian with their little ones the children of Israel took prisoner; and all their cattle and flocks and all their goods they took for themselves; 10 And after burning all their towns and all their tent-circles, 11 They went away with the goods they had taken, man and beast. 12 And the prisoners and the goods and everything they had taken, they took to Moses and Eleazar the priest and the people of Israel, to the tent-circle in the lowlands of Moab by the Jordan at Jericho.

13 Then Moses and Eleazar the priest and the chiefs of the people went out to them before they had come into the tent-circle. 14 And Moses was angry with the chiefs of the army, the captains of thousands and the captains of hundreds who had come back from the war. 15 And Moses said to them, Why have you kept all the women safe? 16 It was these who, moved by Balaam, were the cause of Israel's sin against the Lord in the question of Peor, because of which disease came on the people of the Lord. 17 So now put every male child to death, and every woman who has had sex relations with a man. 18 But all the female children who have had no sex relations with men, you may keep for yourselves.

Matthew Henry's Commentary on Numbers 31:7-18

Commentary on Numbers 31:7-12

(Read Numbers 31:7-12)

The Israelites slew the Kings of Midian. They slew Balaam. God's overruling providence brought him thither, and their just vengeance found him. Had he himself rightly believed what he had said of the happy state of Israel, he would not have thus herded with the enemies of Israel. The Midianites' wicked wiles were Balaam's projects: it was just that he should perish with them, Hosea 4:5. They took the women and children captives. They burnt their cities and castles, and returned to the camp.

Commentary on Numbers 31:13-18

(Read Numbers 31:13-18)

The sword of war should spare women and children; but the sword of justice should know no distinction, but that of guilty or not guilty. This war was the execution of a righteous sentence upon a guilty nation, in which the women were the worst criminals. The female children were spared, who, being brought up among the Israelites, would not tempt them to idolatry. The whole history shows the hatefulness of sin, and the guilt of tempting others; it teaches us to avoid all occasions of evil, and to give no quarter to inward lusts. The women and children were not kept for sinful purposes, but for slaves, a custom every where practised in former times, as to captives. In the course of providence, when famine and plagues visit a nation for sin, children suffer in the common calamity. In this case parents are punished in their children; and for children dying before actual sin, full provision is made as to their eternal happiness, by the mercy of God in Christ.