This chapter is about a battle to eradicate an evil influence. God directed Moses and the people of Israel to annihilate the Midianites. They had successfully defeated Israel, not in battle, but by enticing the nation into idolatry. And that influence could not be allowed to stay active. These were harsh measures against an insidious social degradation. It was the spiritual duty of Israel to obey God’s command in this matter.
One of the casualties of this war was Balaam (Numbers 31:8). It is undoubtedly part of his influence on Israel that even though he could not prophecy against Israel, he could align himself with those who enticed Israel into sin and judgment from God. It was for this deed that he was eliminated. Ultimately his pragmatic practices were his undoing. He died with the ones who paid him the most for his spiritual duties. Not a great end.
That is the real lesson from this chapter. Israel is back to obedience, and a false prophet is judged for his disobedience. He sounded pious when he refused to prophecy against Israel, but in the end his actions of aligning himself with Israel’s enemies showed that profit was his motivation, not prophecy. Human fame and fortune are not enough in the end. They never are.