What do you do with someone like Balaam? He is a hard guy to figure out.
Balaam, son of Beor at Pethor, is a seer and a prophet that is summoned by Barak, king of Moab, to curse Israel (22:4-5). On the way to meet Barak, Balaam has an interesting encounter with his donkey and an angel who stood to oppose him. It seems that he is only allowed to pass because of his humble attitude (22:34) and because of the Lord’s plan and mercy. From our vantage point, Balaam’s error in this matter is difficult to see (except that he is being summoned to curse Israel).
Although he comes to Barak, he repeats this mantra: "I could not go beyond the command of the Lord my God to do less or more (22:18)" – or sayings to this effect (22:38; 23:12, 26; 24:13). Balaam uses the covenant name of the Lord, YHWH, quite frequently in his oracles and his reasoning with Barak on why he will and won't do certain tasks. This knowledge of the Lord could have come through the Lord speaking to him or through the renown of the invading Israelite army and their God.
While Balaam tries to comply with Barak's wishes, each time he is about to curse Israel, he blesses them instead. Barak tries to work around Balaam's inability to curse Israel by moving him from place to place. After three oracles, Barak tells Balaam to flee; “the Lord has held you back from honor” (24:11). Rather than fleeing immediately, Balaam gives Barak some insight as to what the Israelites are going to do to the inhabitants of Canaan.
Balaam's end comes in Numbers 31:8; he is killed with some of the people of Midian. Since the staging point was in the Plains of Moab, we can figure that either Balaam did not go very far, he came back later, or that he never fled from Barak (Pethor, is in Mesopotamia, cf. Deut 23:5). Revelation 2:14 indicates that Balaam taught Barak how to cripple Israel: foreign women and foreign gods. This is the problem in Numbers 25; the people of Israel are captivated by the local culture.
One lesson from the life of Balaam is this: it is not enough to merely be used by the Lord; we must be on His side. Clearly Balaam spoke truth about YHWH and had some knowledge of who He is, but he was still against the people of God and, therefore, God Himself. The Lord is not a machine that is coerced into doing what we want, neither is He someone who tolerates partial obedience and capriciously overlooks hostile alliances. Balaam, for all his oracles and declarations, tried to de-god the Lord.