L’shem shamayim literally means “in the name of heaven”. When you act l’shem shamayim, you have no ulterior motive, no ego involved. The sages praise debates that are l’shem shamayim and say that they are destined to endure, which they see as a good thing. The most famous exemplars of machloket (argument) l’shem shamayim are Hillel and Shammai. Indeed, records of their disagreements are vibrant sources for study until this day.
Rabbi Yossi gives us three pieces of advice (Ethics 2:17): that our friend’s money should be as dear to us as our own; we should prepare ourselves for Torah study, as it is not an automatic inheritance; and that all of our deeds should be l’shem shamayim.
Another phrase, which we have discussed here before, yirat shamayim, fear of heaven, also uses shamayim as a metonymic reference to God. The sky or heavens are omnipresent. Just as you cannot hide from the sky, so too God knows your motives and thoughts, no matter how well you try to conceal them. The vast distance between us and the shamayim symbolises the difficulty of knowing for certain that we have acted l’shem shamayim.