The Gemara discusses the prohibition of deriving personal benefit from Torah study and the praise of learning lishmah, including the danger of making Torah a means for gain. It is a key Talmudic basis for this topic.
וְאָמַר רַבָּה בַּר בַּר חָנָה אָמַר רַבִּי יוֹחָנָן: כׇּל הַמִּשְׁתַּמֵּשׁ בְּכִתְרָהּ שֶׁל תּוֹרָה נֶעְקָר מִן הָעוֹלָם. קַל וָחוֹמֶר: וּמָה בֵּלְשַׁצַּר שֶׁנִּשְׁתַּמֵּשׁ בִּכְלֵי קוֹדֶשׁ שֶׁנַּעֲשׂוּ כְּלֵי חוֹל, שֶׁנֶּאֱמַר: ״וּבָאוּ בָהּ פָּרִיצִים וְחִילְּלוּהָ״, כֵּיוָן שֶׁפְּרָצוּם נַעֲשׂוּ חוֹל — נֶעְקַר מִן הָעוֹלָם, דִּכְתִיב: ״בֵּהּ בְּלֵילְיָא קְטִיל בֵּלְשַׁצַּר״, הַמִּשְׁתַּמֵּשׁ בְּכִתְרָהּ שֶׁל תּוֹרָה, שֶׁהוּא חַי וְקַיָּים לְעוֹלָם — עַל אַחַת כַּמָּה וְכַמָּה. תַּנְיָא: ״לְאַהֲבָה אֶת ה׳ אֱלֹהֶיךָ לִשְׁמוֹעַ בְּקֹלוֹ וּלְדׇבְקָה בוֹ״, שֶׁלֹּא יֹאמַר אָדָם: אֶקְרָא שֶׁיִּקְרָאוּנִי ״חָכָם״, אֶשְׁנֶה שֶׁיִּקְרָאוּנִי ״רַבִּי״, אֲשַׁנֵּן שֶׁאֶהְיֶה זָקֵן וְאֵשֵׁב בִּישִׁיבָה. רַבִּי אֱלִיעֶזֶר בַּר רַבִּי צָדוֹק אוֹמֵר: עֲשֵׂה דְּבָרִים לְשֵׁם פׇּעֳלָם, וְדַבֵּר בָּהֶם לִשְׁמָם. אַל תַּעֲשֵׂם עֲטָרָה לְהִתְגַּדֵּל בָּהֶם, וְאַל תַּעֲשֵׂם קוּרְדּוֹם לִהְיוֹת עוֹדֵר בּוֹ. וְקַל וָחוֹמֶר: וּמָה בֵּלְשַׁצַּר שֶׁלֹּא נִשְׁתַּמֵּשׁ אֶלָּא בִּכְלֵי קֹדֶשׁ שֶׁנַּעֲשׂוּ כְּלֵי חוֹל — נֶעְקַר מִן הָעוֹלָם, הַמִּשְׁתַּמֵּשׁ בְּכִתְרָהּ שֶׁל תּוֹרָה — עַל אַחַת כַּמָּה וְכַמָּה.
And with regard to this statement, Rabba bar bar Ḥana said that Rabbi Yoḥanan said: Whoever makes use of the crown of Torah is uprooted from the world. This can be derived by means of an a fortiori inference: If Belshazzar, who made use of the sacred Temple vessels, which had already become non-sacred vessels by that time, as after their forcible removal from the Temple the vessels lost their sanctity, as it is stated in the verse: “And robbers shall enter into it, and profane it” (Ezekiel 7:22), showing that once the Temple vessels have been robbed they become non-sacred, was uprooted from the world for his actions, as it is written: “On that night Belshazzar the Chaldean king was killed” (Daniel 5:30); one who makes use of the crown of Torah, which lives and endures forever and whose sanctity cannot be removed, all the more so shall he be uprooted. Apropos the story of Rabbi Tarfon’s regret for gaining personal benefit from his status as a Torah scholar, the Gemara cites similar teachings. It is taught in a baraita: The verse states: “To love the Lord your God, to listen to His voice, and to cleave to Him” (Deuteronomy 30:20). This verse indicates that a person should not say: I will read the written Torah so that they will call me a Sage; I will study Mishna so that they will call me Rabbi; I will review my studies so that I will be an Elder and will sit in the academy. Rabbi Eliezer bar Rabbi Tzadok says: Do things for the sake of their performance, not for any ulterior motive, and speak words of Torah for their own sake. Do not make them a crown with which to become glorified, nor make them a dolabra [kordom] with which to hoe, i.e., do not use Torah study as a means of earning a livelihood. And this is an a fortiori inference: If Belshazzar, who made use only of sacred vessels that had become non-sacred vessels, was uprooted from the world, one who makes use of the crown of Torah, whose sanctity is permanent, all the more so shall he be uprooted from the world.