The gemara in Nazir, daf chof gimmel, amud bais and Sanhedrin, daf kuf heh, amud bais and in Horiyus, daf yud gimel, amud bais quotes Rav Yehuda in the name of Rav that one should learn Torah and do mitzvos even if it is not done lishma because the act that was not lishma will end up being lishma. We find that in the z’chus of the forty two korbanos that Balak brought, he was zocheh to have Rus as his granddaughter.
The gemara says that the reason shelo lishma is okay is because one will reach lishma eventually, yet we see that Balak never reached lishma. How was he then zocheh to having such a wonderful reward of Rus as his descendant?
The gemara in Sota, daf chof alef, amud alef says that the Torah protects a person. The gemara in Sukka, daf nun bais and in Kiddushin, daf lamed, amud bais it says that Hashem created the Yetzer Hora, but Hashem created the Torah as an antidote.
The Mesilas Yesharim in Perek Heh says that the above gemara can be compared to a person who is ill and goes to a doctor and the doctor prescribes medication. If the person takes the correct medication he will get healed, but if he takes the wrong medication he will not get healed. The Yetzer Hora can only be cured via Torah and nothing else.
What happens if a person learns Torah, but it is shelo lishma. Will it help against the Yetzer Hora or not?
The velt interprets the gemara of mitoch shelo lishma ba lishma as meaning that a person who learns shelo lishma will eventually learn lishma. From the first question mentioned above we see that the ba lishma does not necessarily mean the person himself gets there; it could be future offspring, like Rus, who did mitzvos lishma and Balak himself never did so.
There is a machlokes between the Divrei Shaul in Megillah, daf yud ches, amud alef and the Nefesh HaChaim concerning someone who learned his whole life shelo lishma. Was he mekayem the mitzvah of limud haTorah? The Divrei Shaul says he will not have been mekayem the mitzvah since it never brought him to the lishma; whereas the Nefesh Hachaim says he is yotze the mitzvah.
The Ohr Hachaim Hakadosh in Parshas Bechukosai seems to be contradicting himself. In the beginning of the parsha the OhrHachaim says that if you learn shelo lishma the Torah still protects you. Later on in Perek Chof Vov, posuk yud daled the Ohr Hachaimexplains on the posuk that says “If you will not listen to me.” the word “Li” means Lishmi, that one must learn lishma otherwise the Torah does not provide protection. That was the reason why the Torah was not protective of Doeg and Achitofel who were talmidei chachamim and learned a lot; however, since the learning was not lishma, the Torah did not protect them. We could explain this contradiction and hereby also establish that there is no machlokes between the Nefesh HaChaim and the Divrei Shaul. There are two types of shelo lishma. The first type is where one learns only to be “lekanter,” to argue and to create fights. Such a shelo lishma will never protect a person. However, the second type of shelo lishma, which is for honor or other reasons, but not necessarily to fight, the shelo lishma will provide protection and will be considered a mitzvah despite the fact that the person never ended up learning lishma. Eventually, one of his offspring will learn lishma.
May we all be zocheh to learn lishma, and even if it is shelo lishma, it should be not be “lekanter.”