If someone was considering taking positive action, but it would be without proper intent, would we recommend that he do it or not?
“Rav Yehuda said in the name of Rav, a person should always engage in the study of Torah and the performance of Mitzvos even if not for their own sake (without pure motives), because from learning Torah and performing Mitzvos not for their own sake, he will eventually come to learn and do Mitzvos for their own sake (out of pure motives). For as a reward for the forty-two offerings that Balak king of Moav offered up to Hashem, he merited that the proselyte Ruth be descended from him, and hence that Solomon be descended from him, of whom it is written: ‘a thousand burnt offerings did Solomon offer up.’”
Balak had hired Bilam to curse the Jewish people. Seeking strategies that would be effective in achieving his goal, Bilam noted that seven altars had been erected by different righteous individuals in the past. His reference was to Adam in Gan Eden, Hevel, Noach, Avraham, Yitzchak, Yaakov and Moshe. Seven also was the number of altars built by our forefathers alone; Avraham built four, Yitzchak built one, and Yaakov built two. Bilam postured that these offering found favor in the eyes of G-d. His suggestion to Balak was to set up seven altars, bringing a bull and ram on each. This was done by Balak on three occasions. He built the seven altars in three locations and a total of forty-two offerings were brought.
Although Balak mimicked, and even expanded on the actions of the righteous, his intention did not match theirs. Nevertheless, he was rewarded for those actions with Ruth being from his progeny leading to King Solomon who brought offerings of even a greater number than he. Although the Talmud indicates that action without proper intent is valued because it can lead to action with the proper intent, that is not what took place with Balak. The intent was bad from beginning to end. Even so, he was rewarded.
How does this jive with the teaching, “If someone does a Mitzvah not for its own sake, it is better that he was not created”? That applies when the intention is destructive, for example he is studying Torah in order to undermine it or its scholars. However, if the study is in order to acquire a name of distinction for oneself, that typifies action with an ulterior motive, which is still meritorious.
How then was Balak rewarded, for his intention was destructive? It stemmed from his fright of the Jewish people and concern for his existence. Therefore, it is considered similar to someone who is motivated by acquiring a name. His actions led to his descendants Kings David and Solomon, bringing offerings with the right intent.
How do we value action – of our own or of others – if it is lacking the right intent? Do we see any redeeming qualities when the actions are ill-intended?
Rabbi Hershel D. Becker
 Melachim 1 3:4
 Sotah 47a
 Balak 22:6
 Bamidbar Rabah 20:15
 Rashi Balak 23:4
 Balak 23:1, 2, 14, 29-30
 Brachos 17a
 Tosfos Nazir 23b
 Balak 22:2,3
 Maharsha Horyos 10b