Twice in Sefer Bamidbar, the Torah recalls Moshe and Aharon’s sin at the "waters of quarreling" and its responsibility for their inability to enter Eretz Yisrael. Both times it mentions their failure to sanctify Hashem. Let us investigate the wording of the Torah’s description in our parasha.
"As you refused My word in the Desert of Tzin at the quarrelling of the congregation to sanctify Me with the water before their eyes; these are the waters of quarrelling of Kadesh in the Desert of Tzin" (Bamidbar 27:14). Why does the Torah give a name to the waters which happen to be the setting for a fateful sin and stress where it took place? The order of the pasuk is also difficult as it seems to indicate that the quarrelling of the congregation was to sanctify Hashem. Although Moshe may have over-reacted to the people’s complaints of lack of water, they certainly did not seem to be sanctifying Hashem with their complaints. The Ibn Ezra answers the second question simply by saying that the pasuk is indeed to be understood as out of order. The sanctifying of Hashem goes on the beginning of the pasuk. Moshe and Aharon refused (according to Unkelus’ translation) to sanctify Hashem. Even if the direct meaning is as Ibn Ezra posits, one can still ask if the Torah’s order is meant to indicate a second level of understanding.
Returning to the first question, Rashi gives two separate, almost opposite explanations of the stress of "the water of quarrelling of Kadesh." One is that it is meant to prompt us to infer that this was a unique event, for only here did Moshe sin. The second explanation is that this was one of three occurrences of a similar phenomenon related to water. As the Siftei Chachamim explains Rashi, these were the same Bnei Yisrael who caused problems at the waters of Marah, where they complained of thirst, and at the [Red] Sea, where they complained about the apparent, impending doom at the hands of the Egyptians. The second explanation seems difficult. First of all, Moshe’s shortcoming, not the nation’s, is the subject of this section, as it explains why he did not enter the Land. Secondly, it is historically questionable. After all, the generation of Marah and the Sea had all but died out by the time Moshe sinned at the rock.
Rashi is indeed elucidating Moshe’s failure by explaining that Bnei Yisrael, although comprising new individuals, were acting a similar way to their predecessors when struck by fear of thirst or death. At Marah and the Sea, Moshe followed Hashem’s instruction with a confidence that the people’s fear would turn into a means of sanctifying Hashem when they would be saved; at the rock, he did not. However, the people were paradoxically providing Moshe the opportunity to sanctify as the strange order of the pasuk hints.
It is difficult but important to remember that not only happy national events but even difficult ones have the potential to boomerang into an opportunity to see Hashem’s Hand positively.