And this from the Revelation to John at Patmos: Jesus words to the angel of the church at Pergamum give us the view of God as to what happened in Numbers chapters 22-25, and why God was angry with Balaam. Balaam was a deceiver.
“But I have a few things against you: you have some there who hold the teaching of Balaam, who taught Balak to put a stumbling block before the sons of Israel, so that they might eat food sacrificed to idols and practice sexual immorality.” Revelation 2:14.
This last verse tells us a bit more about what was going on with Balaam, it appears from what Jesus has said to the Church at Pergamum that some of them were leading people astray in the same way Balaam did. Everything appeared okay on the outside, Balaam was even claiming to speak only what God directed him to speak. But there was gain to be had by him in advising Balak on another way to defeat the Israelites and it appears this is what he did. If we read the first three verses of Numbers chapter 25 we see this.