וְרָאִ֣יתָה אֹתָ֔הּ וְנֶאֱסַפְתָּ֥ אֶל־עַמֶּ֖יךָ גַּם־אָ֑תָּה כַּאֲשֶׁ֥ר נֶאֱסַ֖ף אַהֲרֹ֥ן אָחִֽיךָ׃
И когда ты увидел это, то и ты будешь собирать народ твой, как собрался Аарон, брат твой;
Rashi
כאשר נאסף אהרן אחיך [THOU SHALT BE GATHERED TO THY PEOPLE] AS AARON THY BROTHER WAS GATHERED — From this it is evident that Moses longed for a death similar to that of Aaron (cf. Rashi on Numbers 20:26). — Another explanation: you will die as he died (in the wilderness) because you are no better than he (Midrash Tanchuma, Pinchas 9). — Such indeed is suggested by (Deuteronomy 32:50. 51): “[and die … as Aaron thy brother died …] because you sanctified me not”. Thus it follows, if ye (both of you) had sanctified me your time would not have yet come to depart this life and you would not have died in the wilderness (Sifrei Bamidbar 137:1). In every passage where it writes about their death you will find that it writes about their offence. Because a decree had been made against the generation of the wilderness (those who left Egypt) that they should die in the wilderness on account of the sin that they did not have faith in God, therefore Moses requested that the nature of his offence should be stated in the Torah, so that people might not say, “He, too, was one of those “rebels”. A parable: It may be compared to the case of two women who were punished by the Court; one was an immoral woman and one had merely eaten unripe figs of the sabbatical year’s growth. The latter, therefore, requested that the nature of her offence might be made public, and they did so by proclamation. So, too, here: wherever it mentions their death it mentions also their misdeed, in order to make it known that there was only this single sin in them (Tanchuma 4:6:10 on חקת; Yoma 86b; cf. Sifrei Bamidbar 137:2).
Or HaChaim
וראיתה אתה "and when you have seen it, etc." G'd did not limit Himself to the previous words וראה את הארץ, "and view the land, etc," in verse 12. The Torah wanted to indicate that Moses was enabled to see the land by means of a miracle, i.e. his power of vision was expanded. What Moses beheld could not be seen by ordinary man who is equipped to see only with the help of sunlight; rather it was required that G'd put at Moses' disposal the light which G'd had hidden after Adam had sinned, the light created on the first day of creation (compare Sifri volume 1 item 136). This is also the light G'd put at Moses' disposal in Deut. 34,1. where He showed him the whole of the land of Israel.
Chizkuni
כאשר נאסף אהרן אחיך, “just as your brother Aaron has been gathered.” G-d refers to the reason of their dying before entering the Holy Land, not to the manner of their death, [seeing that Moses had buried his brother Aaron, whereas no one was present at his own death.] Their “premature” death had been due to their having failed to exploit an opportunity to sanctify the Holy Name of Hashem. (Numbers 20,12). This is what Rashi comments on our verse. He adds that this verse is really not at the place where we would have expected it. It really belonged to the portion of Haazinu, where the Torah describes the sin of Moses and Aaron in different terms, [i.e. violating a negative commandment not just failing to observe a positive commandment. (Compare Deuteronomy 32,51)] According to the commentary in Sifri, the verse is appropriate here as the sin Moses and Aaron had been guilty of occurred in the desert of Tzin, immediately after Miriam had died and been buried, not in the fields of Moav where Moses made his final speech to the nation. Rabbi Shimon ben Elazar is on record as saying that both Moses and Aaron died prematurely as a result of failing to sanctify the name of G-d as stated in Numbers 20. It is possible that out of deference to the image of Moses and Aaron, Rashi preferred not to mention the statement of Rabbi Shimon ben Elazar. He only quoted the last item in that comment by Sifri.