The previous three chapters of Numbers tells us of the attempt to destroy Israel by outward means. Perhaps the implication is that there is a bit of magic involved in that Balaam is supposed to influence God to turn on Israel. In any case, all that happens is that Israel is blessed.
Of course, Israel doesn’t know what is going on, just as she didn’t know what was going on with God and Moses at Sinai. Just as the giving of the law was followed by Israel’s idolatry, so the blessing of Israel by Balaam is followed by this event of idolatry and immorality.
Though Satan is unmentioned in chapter 25, his presence is obviously there. If Israel cannot be hurt through outside forces, Satan will use earthly ones against her. The Moabites invited the Israelites to join them in worship to Baal and a part of this worship involved sexual acts. Israel made herself giddy over this practice, which violated two of the ten commandments: not to commit adultery, and not to worship other Gods.
Moses was commanded to kill the leaders of Israel for these sins, but this was not so easily done and apparently Moses watered down the command to include only those guilty of the sin. Perhaps Moses’ disobedience brought on Israel the plague mentioned in verse 9.
In total disdain for the law of God, a son of one of Israel’s leaders brought in a woman in the sight of all and took her into a tent, intending to have sex with her. Phinehas, Aaron’s grandson, put them to death mid-act.
This is an important story. Israel, as a nation, knew the sinful were among them. They knew God’s decree. But other than to bewail their circumstance, no one was willing to do anything. This is what made Phinehas’ actions so admirable.
The story makes clear that not everyone in Israel was guilty of idolatry and promiscuity, but because the guilty were so blatant and unrepentant in their sin, and because the innocent seemed unwilling to do anything about it, God held them all responsible.
The Church, as the People of God, will never be without sin. Part of our work however is to be aware of sin, aware of its presence among us, and active in helping and encouraging one another to live Holy lives. Sometimes, when there is recalcitrance, surgery must be performed and the sinful excised. The alternative is for the many to be held responsible for the sins of the few, and especially will this be true of the leaders of the People of God.