Seeking Closeness Through Humility
ברש"י ואתחנן אף עפ"י שיש לצדיקים לתלות במעשיהם הטובים אין מבקשים מאת המקום רק מתנת חנם
Rashi comments on the words "Va'eschanan" ("And I pleaded") that even though the tzaddikim could rely on their good deeds, they request nothing from Hashem except an undeserved gift.
Rashi teaches that even tzaddikim, who could lean on their merits, ask Hashem only for a free gift rather than payment they have earned.
וקשה שהרי לא הי' המשפט שיכנוס מרע"ה לא"י
This is difficult, for it was in fact not the proper judgment that Moshe Rabbeinu should enter Eretz Yisrael (so why would he have relied on his good deeds in the first place?).
The Sfas Emes raises a question: since Moshe Rabbeinu was not entitled by din to enter Eretz Yisrael anyway, the point about tzaddikim relying on their deeds does not seem to fit here.
אבל הפי' כי הצדיק לא תשבע עינו בעבודת הבורא ית"ש ולעולם רוצה להתקרב אליו ית' יותר ממה שזוכה ע"פ מעשיו ומבקש מתנת חנם
Rather, the explanation is that the tzaddik's eye is never sated with the avodah of the Creator, may His Name be blessed, and he always wishes to draw closer to Him, may He be blessed, more than he merits according to his deeds, and so he requests a free, undeserved gift.
The answer is that a true tzaddik is never satisfied with how close he already is to Hashem; he constantly craves more closeness than his deeds have earned, so he must ask for it as a free gift.
ולפי שכל המצות הם הכנה לדבק בו ית' כדאיתא שרצה מרע"ה לכנוס לא"י לקיים מצות התלויות בארץ
And since all the mitzvos are a preparation to cling to Him, may He be blessed, as is brought down that Moshe Rabbeinu wished to enter Eretz Yisrael in order to fulfill the mitzvos that depend on the Land.
Because the entire purpose of mitzvos is to bond with Hashem, Moshe Rabbeinu longed to enter the Land precisely so he could perform the mitzvos tied to it and thereby cling to Hashem further.
ז"ש במדרש תחנונים ידבר רש על מרע"ה היפוך ממדת בלעם הרשע וסייעתו שכל רצונם להתגאות במעט מדרגה שלו כמ"ש יודע דעת עליון
This is what the Midrash means by the verse "The poor man speaks supplications" (Mishlei 18:23), referring to Moshe Rabbeinu, who is the very opposite of the trait of the wicked Bilam and his company, whose entire desire was to take pride in the little level they possessed, as the verse says of Bilam that he "knows the knowledge of the Most High" (Bamidbar 24:16).
The Midrash applies "the poor man speaks supplications" to Moshe Rabbeinu, who is the mirror opposite of Bilam, whose whole drive was to flaunt the small spiritual level he had attained.
וסימן דלא ידע כלום שבוחי
And the very sign that he knew nothing at all is that he boasted.
The proof that Bilam was in truth empty of real knowledge is precisely that he boasted of it; genuine attainment does not boast.
אבל במרע"ה שאמר אתה החלות כו' וביקש להתדבק בו ית' במתנת חנם זה סימן שיש לו רב כמ"ש רב לך כו':
But with Moshe Rabbeinu, who said "You have begun (to show Your servant Your greatness)" (Devarim 3:24) and requested to cling to Him, may He be blessed, through an undeserved gift, this itself is the sign that he possesses much, as the verse says "You have much" ("Rav lach") (Devarim 3:26).
Moshe Rabbeinu, by contrast, humbly sought closeness to Hashem as an undeserved gift, and that very humility is the sign that he truly possessed great spiritual wealth.
Summary: The Sfas Emes explains Rashi's teaching that tzaddikim ask Hashem only for an undeserved gift rather than reward they have earned. He resolves the difficulty by teaching that a true tzaddik is never satisfied with his current closeness to Hashem and always yearns to draw nearer than his deeds warrant, which is why he must request a free gift; indeed Moshe Rabbeinu longed to enter Eretz Yisrael only to fulfill more mitzvos and cling to Hashem further. This humble craving stands in sharp contrast to the wicked Bilam, whose drive was to boast of the meager level he had reached, the very boasting that proves he had attained nothing real. Moshe Rabbeinu, by humbly seeking closeness as an undeserved gift, demonstrated the trait of one who truly possesses much, as the verse hints in the words "Rav lach."