It is in Parshat Chukat that we meet the second generation of the Jewish nation, the one that would conquer the land of Israel. Yet there is precious little to distinguish it from the first. We are not even formally introduced to them. We first meet them at the death of Miriam, the opening scene of this generation, one that we read about after 38 years of silence. Thirty-eight years where G-d does not speak to Moshe, and 38 years of wandering and death.
One can easily read this story without realizing that we are dealing with a new generation. Even the complaints are the same; lack of water, the preference for Egypt, the disenchantment with the leaders. But a new generation it is.
Sadly it is death that links the two generations. This is seen both in law and narrative. The death of Korach and his partners (not to mention the spies) marks the end of the first generation, whereas the death of Miriam marks the beginning of the second. It the law of red heifer, which details the procedure one must undergo to purify oneself upon contact with death, that links them.
And it was death that marked these 38 years. Whereas it is the death of the people that marked the first generation, it is the death of its leaders that marks the second.
Yet, what is most unclear is why the leaders had to die. We are given no background for the death of Miriam, and while the Torah does gives a reason for the death of Moshe and Aharon, the commentaries are left scratching their heads trying to figure out what it means (and why it would apply to Aharon). The Orach Chaim goes so far as to say that each commentator has found a "new sin" to explain Moshe's sin, and as he does not want to add another sin to Moshe, he will refrain from discussing this episode.
This is often most difficult for many leaders--including (especially?) Moshe--to accept. Yet great leaders understand this. And there was no leader greater than Moshe. Even while Moshe beseeched G-d to enter the land, he gave it his all (see, for example, Rashi Bamidbar 31:2) so that Yehoshua would succeed. Once he understood that he would not lead the people into Israel, he approached G-d to to ask for the appointment of a new leader--the only time we hear the expression "and Moshe spoke to G-d, saying".
New generations come, and we don't even always realize it. The core issues facing one generation are often the same as for their parents. But it takes great leadership to recognize how the differences--often subtle and often not--mean we cannot rely on past responses. Forty years earlier, when the Jewish people complained about the lack of water, Moshe hit the rock. And 40 years later, when the Jewish people complained about the lack of water, Moshe hit the rock. But while the first time that was great, the second it was not (even if that is not the reason he did not enter the land). Even Moshe, in this particular instance, had difficulty comprehending the enormous changes that had happened in 40 years.
May we be blessed with leaders who are capable (if I dare say so, perhaps more so than Moshe) of recognizing when new approaches are needed. Shabbat Shalom!
 Bamidbar weaves back and forth between law and narrative--the counting of the people with the law of the Sotah, the census and Pesach sheni, the meraglim and the Temple libations, the gatherer of trees and tzizit, Korach and pidyon haben, to mention those from the first generation only. This feature, while existent to limited degree in other parts of the chumash, is most pronounced in Bamidbar.
While the simple reading of our parsha is that had Moshe not sinned by the rock, he would have led the people to Israel, as many commentators note, the matter is much more complex. Moshe himself (Devarim 1:37) notes that his denial of entry to the land is due to the sin of the spies, chet hameraglim.
 As the commentaries explain, Moshe's continued beseeching G-d to enter the land was as a layperson under the leadership of Yehoshua.
 It could very well be that Moshe could not enter the land as leader due to the sin of the spies, but it was hitting the rock that denied him entry as a layperson.