Bilaam said to Balak, "Build for me seven altars here, and prepare for me here seven bulls and seven rams. Balak did as Bilaam had said. (Bamidbar 23:1-2)
Rav Yehudah said in the name of Rav: A person should always involve himself with Torah and mitzvos, even if not for altruistic reasons for this will bring one to do it for the right reasons; [as we see from Balak, for,] the reward for the forty-two sacrifices that Balak, king of Moav, offered, he merited that Rus should come from him, from whom came Shlomo HaMelech, of whom it is written, "Shlomo offered one-thousand Burnt-Offerings upon the altar (Melachim 1:3:4) ... (Sota 47a)
This statement is remarkable on two accounts. First of all, are there no better examples of Jews who actually learned Torah and did mitzvos without the proper intention, who later turned around and learned Torah for the right reasons? Secondly, Balak was offering sacrifices to turn G-d against the Jewish people; should he merit from this a descendant who would later become a righteous convert to the Jewish people, and Shlomo HaMelech who would later build the Temple?
Would this have even been a merit in Balak's eyes?
The answer to this question might be found in a comparison of Balak to Bilaam. The parsha starts off by telling us,
Balak the son of Tzippor saw all that the Jewish people did to the Amorites. Moav was very afraid because the people were numerous ... (Bamidbar 22:2)
He [Balak] was not really entitled to the kingdom, being, in actuality, a Midianite prince. However, when Sichon and Og died [at the hands of the Jewish people], they [the Moabites] appointed him king over them to meet the needs of the time. (Rashi)
In other words, Balak, as terrible a role as he played in the entire plot to curse the Jewish people, he had done so out of concern for the welfare of the Moabites, and perhaps himself as well. The existence of the Jewish people might not have bothered him had the Jewish people merely lived somewhere else where they couldn't cause him or the surrounding peoples any harm.
This could not be said about Bilaam who was bothered by the very existence of the Jewish nation. We know this because back in Egypt, when Pharaoh was trying to decide on the best course of action to confront the "Jewish threat," it was Bilaam who advised him to annihilate them. Yisro (Moshe's future father-in-law) had advised Pharaoh to leave them unharmed, warning Pharaoh that any evil plan would only backfire on him one day; Eyov (Job), Pharaoh's third advisor, simply abstained from casting any vote at all (Shemos Rabbah 1:31). Thus we see that Bilaam was bent on destroying the Jewish people.
This is why in connection to Bilaam, who also sacrificed to G-d, there is no mention of any reward for doing so anywhere. Indeed, the Talmud instead talks about his horrible punishment, measure-for-measure, for the sin he caused the Jewish people to commit (Gittin 57a). Nothing good could have come out of Bilaam's sacrifices, for his hatred of the Jewish people, and therefore G-d Himself, was intrinsic to his very being. (This is why, according to some, Bilaam was
missing an eye: it was the only part of him that wasn't defiled (being empty) where G-d could allow some form of prophecy to dwell within him.)
However, the very fact that Ruth came from Balak indicates that there was some spark of holiness still within him that could be drawn out eventually, and used for good. But only enough to create one Ruth, and nothing more, and after she left Moav and became part of the Jewish people, it was her descendant, Dovid HaMelech, who eventually begin to do away with Moav itself.
In the end we learn that if a non-Jew, who was not commanded in mitzvos, could contribute so much to the Future Redemption of the Jewish people, how much more so can a Jew, who is commanded to live by Torah, contribute. Had Balak not been so encased in falsehood and selfishness, perhaps he might have noticed the good he had inside of him also, and he would have consciously used it in the right direction.
(Author, lecturer, and scholar Rabbi Pinchas Winston is the director of ThirtySix.org