Bible Commentary
Numbers 31
Vengeance on the Midianites—and on Balaam
As the last task to perform before Moses' death, God commands him to take vengeance on the Midianites because they, with the Moabites, deliberately set out to destroy the Israelites through their idolatrous religious practices. Furthermore, making a stark example of the Midianites in destroying them would serve as a deterrent to future apostasy. Incredibly, not a single Israelite dies in the war, moving their leaders to make a special offering. The officers over thousands, etc., come to Moses to make a voluntary offering to God to cover everything, an atonement offering (verses 48-50). God is with Israel in this righteous battle—signified by the fact that Phinehas also goes to war with the Ark of the Covenant and the two silver trumpets. It is God who gives them the victory.
Interestingly, verse 8 mentions that one of the men who was slain in the war was Zur. This Zur was apparently one of the instigators of the plot to bring false worship to Israel. Indeed, it was his daughter, Cozbi, that Zimri had brazenly paraded before the congregation of Israel before they were both slain by Phinehas (Numbers 25:14-15). In verse 9, we see the women of Midian taken captive in the wake of the battle. Moses, however, is incensed at this, as these are the same women who led Israel astray with the Moabites—and he commands that all but the virgins among them be put to death (verses 14-18). Besides their idolatrous practices, it is also possible that the promiscuous Midianites had sexually transmissible diseases that God wanted to keep out of Israel as well.
Verse 16 is the verse that actually explains what happened in the incident of Baal Peor. We learn that it was the "counsel of Balaam" that the Midianite women followed when they caused the children of Israel to sin against God, resulting in the plague that cost 24,000 lives. Without this explanation, readers of chapters 22-24 might give Balaam the benefit of the doubt, assuming him to have been a prophet who was following God's will. But note this: Balaam did not "die the death of the righteous," as he had so eloquently prayed (Numbers 23:10). Rather, he died by the edge of the sword—being justly put to death along with the Midianites by the Israelites at God's command (verse 8).
So just what lesson can we learn from Balaam? Notice this from the article on him in The Complete Who's Who in the Bible: “2 Peter 2:15, Jude 1:11 and Revelation 2:14 warn the NT people of God against allowing a smooth-talking pagan to capitalize on his knowledge in the form of religiosity and twist it to his own deadly end. A veneer of piety disguises the shallow convictions which can be bought for a price (Numbers 22:17) and superficial repentance (v. 34) which is short-lived. 2 Peter 2:15-16 views Balaam as a man of prophetic talent but with a desire to use the gifts of God to further his own ends. So, Peter warned of the danger of 'empty' words because they act as a cover for evil desires. The Christian must appreciate that such emptiness of heart will be exposed on judgment day (Jude 1:11). For the apostle John writing to the compromising church in Pergamum the worse sin is not actually that of self-deception, because that in the end will be exposed. Rather, Balaam's leading of Balak [and thus Israel] into further spiritual adultery is far worse. And so, the worst of judgments is saved for those who knowingly deceive others. Like Balaam their sin eventually catches up with them (see Numbers 31:8, Joshua 13:22)" (Paul D. Gardner, ed., 1995).