Bible Notes Online - Numbers 25 - ESV
Commentary

v1-3: It appears that, through Balaam's influence, Israel and Moab joined together, leading to prostitution and idolatry; see Rev 2.14. Balaam had tried a series of curses, which were apparently ineffective; but Israel succumbed easily to sexual sin. Sexual sin is powerful. Avoid!

Moab had originally been afraid of Israel (22.3), which was why Balaam was hired in the first place. His words encouraged Moab to join with Israel, which was the stumbling block, referred to in Rev 2.14. Although Balaam's influence was significant, Israel remained responsible for their own sins.

v4-5: The leaders, having set a poor example, which the people had followed, had to bear the judgment of God. Moses delegated this task to the judges amongst the people.

v6: The sins had become blatant and bold, the man was unrepentant, for this incident followed Moses' announcement to the judges, in v5. There was already sorrow as the judgment began. It seems there was the plague from the Lord, and the capital punishment by Israel's judges.

v7-9: Phinehas' action was decisive against sin, and reflected God's heart (see v11). As a result, the plague which had already begun, was stopped.

v10-11: The Lord commended Phinehas for his zeal. Zeal must be from God, otherwise it is ineffective. Zeal is decision with passion. The Lord Jesus acted with zeal, see John 2.17.

v12-13: The reward for Phinehas, the covenant of peace, and of the lasting priesthood. Phinehas was the grandson of Aaron, and therefore in line for the priesthood in any case.

v14-15: Following from v4, the people killed by Phinehas were leaders, both in Israel and Midian (or Moab).

v16-18: The Lord's instructions, that the Midianite people were to be killed, because they had joined with Moab (22.7) to attack Israel. The attacks were blatant and frontal, but also using subtlety and deception.