If you remember the story of Balak and Balaam from the book of Numbers you probably remember that Balaam didn’t accomplish what Balak asked. But it turns out, Balaam was quite effective, just in another way.
Balak, the king, originally tried to hire Balaam, a prophet, to curse Israel (Numbers 22:1-6). Balaam was interested in the money, and was almost killed on his way to meet Balak, saved by his faithful donkey who stopped him short of the sword of the angel of the Lord (Numbers 22:23, 25, 27). The LORD prohibited Balaam from cursing Israel, in fact, the LORD caused Balaam to pronounce a verbal blessing on the, which only made Balak more irritated (Numbers 23:11-12).
However, a few chapters later, we learn that Balaam had some effective advice.
“Behold, these, on Balaam’s advice, caused the people to act treacherously against the LORD in the incident in Peor, and so the plague came among the congregation of the LORD” (Numbers 31:16).
The “incident” was the men of Israel taking Midianite women, committing sexual immorality with them, and then worshipping their gods. The Israelites weren’t pure in their relationships or their religion, and according to Moses, the temptations came about due to Balaam’s strategy.
Jesus refers to some in Pergamum who were holding to Balaam’s teaching (Revelation 2:14), and they were those indulging themselves similarly in immorality and idolatry.
But we should know better and not listen to anyone who “does not agree with the sound words of our Lord Jesus Christ and the teaching that accords with godliness” (1 Timothy 6:3).