What does it mean to learn lishmah? Can you explain the different views?
There are several different view in this matter.
1. According to the Nefesh Ha-Chaim, the intention is that one must study for the “sake of the Torah itself,” and not for the sake of practice or for any other motive. The Torah itself encapsulates a dynamic spiritual reality, and one must learn for the sake of the Torah, and not for anything else. See Nefesh Ha-Chaim, Shaar 4, Chaps. 3-6.
2. In a similar vein, the Chasam Sofer (Nedarim 81b) explains the matter as meaning that a person must study for the sake of study, and not for the sake of knowledge. This is similar to the exposition of the Beis Ha-Levi on the Gemara of the Destruction coming on account of the people not reciting the berachah on Torah study.
3. Chassidic Masters generally understood the meaning to be that one should study in order to achieve devotion and closeness to Hashem, and in order to effect the great effect of Torah on the person studying and on all of the worlds.
4. For the sake of fulfilling the mitzvos. Torah lishmah can be understood to mean that a person must study for the sake of fulfillment, as the Sages teach – Torah study must be for the sake of practice. If I remember correctly a statement to this effect is made by the Vilna Gaon.
5. For no ulterior motive. Perhaps most simply, Torah lishmah can be understood to mean study without ulterior motives – not for the sake of being called a rabbi, and so on.
[I have unfortunately not had the chance to check sources, but will bli neder do so later and add them in.]