In Parshas Va'etchanan, Moses tells that he begged to enter the Land of Israel until G-d got angry:
וַיִּתְעַבֵּר ה' בִּי לְמַעַנְכֶם וְלֹא שָׁמַע אֵלָי וַיֹּאמֶר ה' אֵלַי רַב־לָךְ אַל־תּוֹסֶף דַּבֵּר אֵלַי עוֹד בַּדָּבָר הַזֶּה׃
But the LORD was wrathful with me on your account and would not listen to me. The LORD said to me, “Enough! Never speak to Me of this matter again!
It's fair to assume that Moses was completely selfless and all his wants were about helping the nation and reaching the final Geulah. Also, the prayer seems a legitimate way of communicating one's needs with G-d.
Why did G-d become angry with Moses?