In the Old West, towns whose sheriff or deputies killed a criminal would display the corpse in public as a warning to other desperadoes to keep away and tangible proof that the law was in control. Outlaws should seek victims elsewhere.
Similarly, in the Ancient Near East, the heads of defeated foes would be impaled on sticks and used to warn and demoralize one’s enemies. A custom such as this seems to be what is meant in today’s reading, in which God commanded that idolaters be executed and their bodies exhibited as part of Israel’s repentance (vv. 4–5).
How had the nation been led into idolatry? Balaam was to blame (see Num. 31:16). Perhaps threatened with no pay for blessing Israel rather than cursing them, Balaam offered Balak advice about how to undermine Israel spiritually. If they could be tempted away from the Lord and into sexual immorality and idolatry—and the fertility rites of Baal would have led to both sins (vv. 1–3)—perhaps the Moabites and Midianites wouldn’t be devoured like grass in the fields after all.
While Moses was giving the instructions for repentance mentioned above, an Israelite leader and his Midianite lover brazenly entered the camp, right in front of everyone (vv. 6, 14)! They may even have been going into the tent for sex, since one spear thrust killed them both.
They showed complete contempt for the Lord and roused the righteous anger of Phinehas, son of the new high priest, Eleazar. Thanks to Phinehas’s prompt action, God stopped His plague judgment against Israel (vv. 7–11). He also renewed His “covenant of peace” with the line of Aaron, affirming a “lasting priesthood” through Phinehas “because he was zealous for the honor of his God” (vv. 12–13).