In reading Numbers 22 we will see that Balaam is guilty of three mistakes. The first is that he puts himself in a place to fall. God had already told him "no" yet he keeps coming back because he wants the money. By staying close to the temptation and not fleeing from evil, Balaam eventually succumbs to the temptation and though he could not curse Israel, he teaches Balak how to cause the Israelites to be curse by God.
The second mistake is that he lost complete perspective of who he was in the Lord. He was a prophet of God. The Lord had entrusted him with words to speak. When Balaam blessed people, they were blessed. And when he cursed people, they were cursed. Balaam knew the power of God and that he could not go against the Lord. But somewhere the love of money becomes the draw that makes him forget that He belongs to the Lord. The craving for the world overrode his desire to be pleasing to the Father.
The third mistake that he makes is that he is hoping God would change His mind. This is a mistake that I believe most of us make. We know God's word, but maybe for this moment God will allow this to happen for me. He will change His nature and His purpose so that I can have my desires fulfilled. Balaam over and over is looking for God to change his mind so that he can have the money.
The man of God loses his wisdom because of his greed. Peter says that when the donkey rebuked Balaam, the donkey was restraining the insanity of the prophet. We become foolish and crazy when we are dictated by our desires! That is why the continue call to all God's people is "Seek first his kingdom and his righeousness, and all these things will be added to you.