Balak son of Zippor saw all that Israel had done to the Amorites. Moab was alarmed because that people was so numerous. Moab dreaded the Israelites, and Moab said to the elders of Midian, “Now this horde will lick clean all that is about us as an ox licks up the grass of the field.” Balak son of Zippor, who was king of Moab at that time, sent messengers to Balaam son of Beor in Pethor, which is by the Euphrates, in the land of his kinsfolk, to invite him, saying, “There is a people that came out of Egypt; it hides the earth from view, and it is settled next to me. Come then, put a curse upon this people for me, since they are too numerous for me; perhaps I can thus defeat them and drive them out of the land. For I know that whomever you bless is blessed indeed, and whomever you curse is cursed.” The elders of Moab and the elders of Midian, versed in divination, set out. They came to Balaam and gave him Balak’s message. He said to them, “Spend the night here, and I shall reply to you as יהוה may instruct me.” So the Moabite dignitaries stayed with Balaam. God came to Balaam and said, “What do these men want of you?” Balaam said to God, “Balak son of Zippor, king of Moab, sent me this message: Here is a people that came out from Egypt and hides the earth from view. Come now and curse them for me; perhaps I can engage them in battle and drive them off.” But God said to Balaam, “Do not go with them. You must not curse that people, for they are blessed.” Balaam arose in the morning and said to Balak’s dignitaries, “Go back to your own country, for יהוה will not let me go with you.” The Moabite dignitaries left, and they came to Balak and said, “Balaam refused to come with us.” Then Balak sent other dignitaries, more numerous and distinguished than the first. They came to Balaam and said to him, “Thus says Balak son of Zippor: Please do not refuse to come to me. I will reward you richly and I will do anything you ask of me. Only come and damn this people for me.” Balaam replied to Balak’s officials, “Though Balak were to give me his house full of silver and gold, I could not do anything, big or little, contrary to the command of my God יהוה. So you, too, stay here overnight, and let me find out what else יהוה may say to me.” That night God came to Balaam and said to him, “If the agents have come to invite you, you may go with them. But whatever I command you, that you shall do.”
Word of Balaam son of Beor,
Word of the man whose eye is true,
Word of one who hears God’s speech,
Who beholds visions from the Almighty,
Prostrate, but with eyes unveiled:
How fair are your tents, O Jacob,
Your dwellings, O Israel!
Like palm-groves that stretch out,
Like gardens beside a river,
Like aloes planted by יהוה,
Like cedars beside the water;
…. The Book of Balaam, son of Beor, seer of the gods. The gods came to him at night and communicated to him the oracle of El. They said to Balaam, son of Beor, “Thus [the gods] will do…”
Source: https://www.thetorah.com/article/balaam-and-the-problem-of-other-peoples-revelation, translation from Baruch A. Levine, Numbers 21-36 (Anchor Bible; NY: Doubleday, 2000)
Yet [the Midianite women] are the very ones who, at the bidding of Balaam, induced the Israelites to trespass against יהוה in the matter of Peor, so that יהוה’s community was struck by the plague.
(יט) כָּל מִי שֶׁיֵּשׁ בְּיָדוֹ שְׁלשָׁה דְבָרִים... עַיִן רָעָה, וְרוּחַ גְּבוֹהָה, וְנֶפֶשׁ רְחָבָה, מִתַּלְמִידָיו שֶׁל בִּלְעָם הָרָשָׁע.
(19) Whoever possesses these three things... An evil eye, a haughty spirit and a limitless appetite he is of the disciples of Balaam, the wicked.
קוסם באמתו היה כתיב הכא נופל וגלוי עינים וכתיב התם (אסתר ז, ח) והנה המן נופל על המטה וגו' איתמר מר זוטרא אמר קוסם באמתו היה מר בריה דרבינא אמר שבא על אתונו
מ"ד קוסם באמתו היה כדאמרן ומ"ד בא על אתונו היה כתיב הכא (במדבר כד, ט) כרע שכב וכתיב התם (שופטים ה, כז) בין רגליה כרע נפל שכב וגו' (במדבר כד, טז) ויודע דעת עליון השתא דעת בהמתו לא הוה ידע דעת עליון הוה ידע מאי דעת בהמתו דאמרי ליה מאי טעמא לא רכבת סוסיא אמר להו שדאי להו ברטיבא אמרה ליה הלא אנכי אתונך לטעינא בעלמא אשר רכבת עלי אקראי בעלמא מעודך עד היום הזה ולא עוד אלא שאני עושה [לך] מעשה אישות בלילה כתיב הכא (במדבר כב, ל) ההסכן הסכנתי וכתיב התם (מלכים א א, ב) ותהי לו סוכנת
The Gemara relates: Balaam was a diviner by using his penis. It is written here: “Fallen, yet with opened eyes” (Numbers 24:4), and it is written there: “And Haman was fallen upon the divan whereupon Esther was” (Esther 7:8), indicating that the verb fallen has sexual connotations. It was stated that there is an amoraic dispute with regard to this matter. Mar Zutra says: Balaam was a diviner by using his penis. Mar, son of Ravina, says: He engaged in bestiality with his donkey.
The one who says that he was a diviner by using his penis derives it as we stated. And the one who says that he engaged in bestiality with his donkey derives it as follows: It is written here: “He crouched, he lay down” (Numbers 24:9), and it is written there: “Between her legs he sunk, he fell, he lay” (Judges 5:27), which is interpreted as a reference to sexual intercourse between Sisera and Jael. § Balaam describes himself: “And he knows the knowledge of the Most High” (Numbers 24:16), and the Gemara asks: Now, if the knowledge of his animal he did not know, is it possible that the knowledge of the Most High he knew? The Gemara explains: What is the meaning of the knowledge of his animal? The princes accompanying him said to him: What is the reason that you did not ride horses? Balaam said to them: I brought the horses to graze in the pasture and rest there. The donkey said to him: “Am I not your donkey” (Numbers 22:30)? Balaam said to the donkey: Merely for burdens, not for riding. The donkey said to him: “Upon which you have ridden” (Numbers 22:30). Balaam said to the donkey: That was mere happenstance and is not a regular occurrence. The donkey said to him: “Your whole life until this day” (Numbers 22:30). The donkey continued: Moreover, I perform a conjugal act for you and we engage in bestiality at night. From where is this derived? It is written here: “Was I ever wont [hahasken hiskanti] to do so to you” (Numbers 22:30)? And it is written there with regard to Abishag the Shunammite: “And let her be a companion [sokhenet] to him” (I Kings 1:2). Just as the root samekh, kaf, nun indicates sexual relations in the case of Abishag, the same is true with regard to the donkey. Balaam was unable to best his donkey in a debate.
https://www.thetorah.com/article/balaam-the-seer-is-recast-as-a-villain
This change in attitude towards Balaam is easily explainable against the backdrop of Deuteronomistic theology. This school of thought, whose foundational belief was that YHWH chose Israel to be a holy nation, could no longer accept that outsiders could play an active, positive role in Israel’s history or destiny, since Israel’s special place in this world is revealed in YHWH’s unique relationship with them. [...]
This is even truer when it comes to prophecy. True prophecy, according to Deuteronomy (18:13–20) is designed to continue the legacy of Moses and communicate God’s will to the people. It can only be accomplished by another Israelite מקרבך “from among you” (v. 15), מאחיך “from your brethren” (v. 15), מקרב אחיהם “from among their brethren” (v. 18). Among the other nations, prophets are merely קוסמים ומעוננים “diviners and conjurers” (v. 14), both abominations to YHWH.
Accordingly, if the Deuteronomist inherited traditions about Balaam, who abides by the word of YHWH, and “who speaks the words that God puts in his mouth” (Num 22:38, 23:5), he would need to interpret this anew to fit his worldview. Thus, he changed Balaam into an enemy, one who spoke against Israel and tried to convince YHWH to destroy them, and to one who was on the brink of cursing Israel until YHWH changed the curses into blessings, essentially forcing Balaam to bless Israel instead of cursing them.
[...] During [the 6th C. BCE], the story of Balaam’s donkey and the angel were added into the Balaam account. [...] The addition of the anecdote into the otherwise complimentary Balaam account weakens the character’s heroic status and lays the groundwork for the Deuteronomic interpretation of the story discussed above.
https://reformjudaism.org/learning/torah-study/torah-commentary/will-real-balaam-please-stand
While the commentators see Balaam as only wicked, I find the multi-faceted understanding of Balaam important to maintain. In the Torah text, he is not all good, nor is he all bad. He is human. He is an individual with conflicting desires who behaves differently in different situations. Perhaps this is Balaam's lesson to us.
One of the gifts that the Torah gives the world is multi-dimensional characters. The Israelite leaders consistently have flaws and act in ways that challenge us. They remind us of our own humanity and that of those around us. Humans are multi-dimensional, messy people. Balaam gives us another taste of that. Here is someone who is working with an enemy of the Israelites, but he is not one-dimensional.
It can be easy to recognize complex personalities in the ones we love - and harder in ones who we do not understand or seem to be opposed to us. Balaam reminds us of their complexity as well. The commentators have painted Balaam as fully wicked, but I challenge us to see Balaam, like Abraham, as human - and bring this awareness into our thoughts and feelings about those in our own lives.