In a 2001 lecture on Numbers 22-23, Dennis Prager says: Balaam goes on with Balak’s dignitaries. Balaam tells Balak I can only say that God tells me.
It is possible to believe in God and wish that God will allow you to do what God does not want. It is possible to believe in God and to hope that God will forgive you.
If belief in God ensured that you did the right thing then every believer would be a saint. Not true.
While belief in God is no guarantee that you will overcome your desires, only God will help many to overcome their desires.