Bible Notes Online - Numbers 31 - ESV
Commentary

v1-2: See 25.17-18; the previous prophecy and command had to be fulfilled. This was Moses' final task. In contrast, David had Solomon carry out such vengeance on his behalf. We also see that Eleazar's leadership was important in this incident.

v3: The "Lord's vengeance"; this was not personal, nor even national. God had commanded the destruction of the Midianites, because they had brought corruption within the Israelites.

v7-12: The battle was successful, in that the entire Midianite army was destroyed, and much plunder taken.

v14-18: Moses was concerned that dealing with the Midianites was thorough. The army had kept alive the women, but Moses pointed out that these had earlier led Israel astray. They thus had to be put to death. Such evil influences had to be severely dealt with.

Inaction is not enough, for that can invite sin; see note at 30.14, where silence could mean approval.

v19-24: The returning army had to be purified. This was part of Moses' final testimony.

v27: All would share in the spoils of victory; compare 1 Sam 30.24-25.

v32-35: There was a vast amount of spoil; 32,000 virgins reflects a very large army, compared to Israel's 12,000. We also learn that not one Israelite was killed (v49), such was the power of God to bring victory.

v50: As well as the portions specifically set aside, the military leaders brought an offering of the personal spoil they had collected (see v53). Even in victory there was some defilement (see v19, 24), so there was a need for atonement.