"The Children of Israel, the entire community, came to the Zin Desert in the first month, and the nation dwelt there in Kadesh; and there, Miriam died, and she was buried there." (Numbers 20:1)
In the previous chapter, God commanded us the statute of the Red Heifer, concluding the (approximately) one-and-a-half-year period starting from the Exodus. Now, after a gap of some thirty-eight years, the Torah resumes the history of Israel with the nation arriving in the Zin Desert, east of the River Jordan. The Torah entirely ignores this thirty-eight year period - nothing of lasting significance happened to the generation that had been condemned to die in the desert for the sin of the spies.
By now, on the 10th of Nisan 2447 (Targum Yonatan to Numbers 20:1), precisely one year before entering the Land of Israel under Joshua on the 10th of Nisan 2448 (Joshua 4:19), the generation of slaves has passed away. Rashi explains the phrase "the entire 
Why did all three sustainers have to die in the desert?
community" accordingly: "The community in its entirety [or, the perfect community], because all those who were destined to die in the desert had already died, and these were the ones who had been designated for life." The Ibn Ezra similarly comments: "There is no mention in the Torah of any event or prophecy, apart from the first year and the fortieth year. And the reason that 'the Children of Israel, the entire community, came' is that the generation of the desert had died, and now those who were to reach the land of Canaan came." The inference is unmistakeable: the entire community are those Jews who merited to enter the Land of Israel; the 600,000 men who died in the desert are discarded.

Why did all three sustainers have to die in the desert?
community" accordingly: "The community in its entirety [or, the perfect community], because all those who were destined to die in the desert had already died, and these were the ones who had been designated for life." The Ibn Ezra similarly comments: "There is no mention in the Torah of any event or prophecy, apart from the first year and the fortieth year. And the reason that 'the Children of Israel, the entire community, came' is that the generation of the desert had died, and now those who were to reach the land of Canaan came." The inference is unmistakeable: the entire community are those Jews who merited to enter the Land of Israel; the 600,000 men who died in the desert are discarded.Apart from recording the death of Miriam, this parasha also records the death of Aharon (20:23-29) four months later (33:38-39), as well as Moshe's being condemned to die in the desert (20:12). These three siblings were more than just leaders of the nation from the time of slavery in Egypt until this point: "Three good sustainers stood up for Israel - Moshe, Aharon, and Miriam; and three beneficial gifts were given by them - the well [which miraculously followed them through the desert], the clouds [of glory], and the manna. The well was in Miriam's merit; the clouds were in Aharon's merit; the manna was in Moshe's merit." (Ta'anit 9a)
The question cries out to be asked: Why did all three sustainers have to die in the desert? Would it not have been appropriate for them - at least one, if not all - to have remained alive to lead the nation into its land?
I believe that the answer can be found in the narrative of Honi HaMe'agel (the circle-maker).
"One day, [Honi] was going on his way when he saw a man planting a carob tree. He said to him: 'How long will it be before this produces fruit?' The man replied: 'As much as seventy years.' He said to him: 'Will you live seventy years more?' The man replied: 'I found carob trees in the world, which were planted by my ancestors for me; and I am similarly planting these for my descendants.' [Honi] sat down to eat, and sleep overcame him... and he slept for seventy years....
"He went to the beit hamidrash, where he heard the rabbis say: 'This is as clear to us as it was in the days of Honi the circle-maker, because when he would come to the beit hamidrash, every difficulty that the rabbis had he would explain.' He said to them: 'I am he,' but the scholars neither believed him nor gave him the respect that he deserved. This distressed him so much that he prayed [for death], and he died." (Ta'anit 23a)
Honi clearly had been a great scholar in his day, a leader of his generation, but seventy years on, in a new generation, he could no longer lead. Each generation, every historical period, needs the leaders that are appropriate for it. Moshe, Aharon and Miriam, the leaders and sustainers of the generation of slavery, of Egypt, and of the desert, could not be the leaders of the generation of Eretz Yisrael. For that new epoch, there had to be a new leader.
Moshe had been the perfect leader for Israel because he had grown up free, a prince in Pharaoh's royal palace, and was therefore free of the slave mentality that afflicted that entire generation of Jews. He was indeed the appropriate man to lead a generation of slaves out of slavery through the desert, where they needed to be re-educated as a free nation, to Sinai, where they would receive the Torah that would make them spiritually free, and to the edge of Eretz Yisrael. But the generation that would inherit Eretz Yisrael needed a leader who had grown up as one of them, not as a prince who would stand above them.
Among Moshe's final lessons to the nation was his leadership in the first battles that they would fight to begin the conquest of the Land - the battles against the Canaanite king of 
The generation that would inherit Eretz Yisrael needed a leader who had grown up as one of them.
Arad (21:1), against the Amorites (21:21-31), against Bashan (21:33-35), and others. In the first of these battles, "the Canaanite king of Arad, who dwelt in the Negev [the south of Israel], heard that Israel was approaching by the route of the spies. And he fought against Israel, and he captured a captive from it." (21:1) He captured only one captive, a slave woman (Rashi, ad loc; Yalkut Shimoni 764), "and he killed no one." (Sforno). Moshe's response to a single captive, and no deaths, was not to attempt to make peace with this enemy king; neither did he negotiate for the return of this captive; nor did he organise a brief foray into his territory with the intention of withdrawing as soon as possible; nor yet did he call on an outside force to help settle their differences. Rather, he led Israel in battle to defeat this king, annihilated his city, and renamed it Hormah ("utter destruction") to eternalise the lesson of how a true Jewish leader responds to a Jew being taken captive by an enemy army.

The generation that would inherit Eretz Yisrael needed a leader who had grown up as one of them.
Arad (21:1), against the Amorites (21:21-31), against Bashan (21:33-35), and others. In the first of these battles, "the Canaanite king of Arad, who dwelt in the Negev [the south of Israel], heard that Israel was approaching by the route of the spies. And he fought against Israel, and he captured a captive from it." (21:1) He captured only one captive, a slave woman (Rashi, ad loc; Yalkut Shimoni 764), "and he killed no one." (Sforno). Moshe's response to a single captive, and no deaths, was not to attempt to make peace with this enemy king; neither did he negotiate for the return of this captive; nor did he organise a brief foray into his territory with the intention of withdrawing as soon as possible; nor yet did he call on an outside force to help settle their differences. Rather, he led Israel in battle to defeat this king, annihilated his city, and renamed it Hormah ("utter destruction") to eternalise the lesson of how a true Jewish leader responds to a Jew being taken captive by an enemy army.Though each generation needs the leader who is appropriate to it, the demands that the Torah makes of a Jewish leader are eternal and unchanging. Whether a Moshe leading the nation out of slavery, or a Joshua leading the conquest of Israel, or a David leading the nation in wars in Israel, or a Solomon leading the nation in its golden age of peace and prosperity, or an Ezra leading the nation back to its land after the first exile, or a leader in our own days, the leadership, though it must adapt, can never compromise on the Torah of Israel, on the Land of Israel, or on the People of Israel. And just as a Jew who denies even a single word of the Torah, though he accepts all the rest of it, is a heretic (Rambam, "Laws of Repentance" 3:8), so, too, one who is willing to abandon even a single Jew - whether in Lebanon, Gaza, or a prison in the USA - is a traitor to the entire nation and can never lead them.