Balaam hoped that God would change His mind and curse Israel on behalf of King Balak and Moab, for then the king would give the prophet a great financial reward.
Balaam told Balak to build seven altars and have seven rams and seven bulls prepared.
“And Balak did just as Balaam had spoken, and Balak and Balaam offered a bull and a ram on each altar. Then Balaam said to Balak, ‘Stand by your burnt offering, and I will go; perhaps the LORD will come to meet me, and whatever He shows me I will tell you.’ So he went to a desolate height” (Numbers 23:2-3).
Balaam knew that when God spoke, the prophet had to report it just as God had spoken it, but the prophet kept approaching God with the hope that He would change His mind, because although Balaam respected the word of God, the prophet had his eyes on riches offered by Balak.
Balaam is not the only one in history to let materialism of one sort or another turn him from God.
Later in the story the prophet persuaded the Moabites to seduce the Israelites into idolatrous worship, and then God would curse Israel, and Balaam did that as a way of getting the financial reward promised by Balak.
How many people today turn their eyes from being faithful to God to gain a dollar?