In Parshas BeShalach when Hashem first wanted the water to flow from the rock Hashem told Moshe to hit it. Why 40 years later when Hahsem wanted to renew the water flow after Miriam’s death was Moshe punished for hitting it? The Netziv in the Hemek Davar explains that in the 40th year in the Midbar since the Bnei Yisroel were preparing for ordinary life in Eretz Yisroel, Hashem drastically curtailed Bnei Yisroel’s dependence on miracles (Hanhaga Nisi) and led them in an almost natural way (Hanhaga Tiv’i) as opposed to the first 39 years where their whole existence was based on Nisim.
How do you make water flow from a Rock without a Nes??The gemara in Taanis says that when there is a drought the tzadikim should gather everyone together and talk to them about doing tshuva to bring the rain. Therefore now in the 40th year, Hashem did not want Moshe to hit the rock since that would constitute a Nes. When Hashem told Moshe to speak to the rock He didn’t mean talk to the rock, rather Hashem wanted Moshe and Aharon to speak to the people and daven for rain in front of the rock. When Moshe got angry the whole plan failed and he ended up hitting the rock with his special stick to bring water through a Nes and not through tefila.
The direct consequence of this, explains the Netziv, is that Moshe failed the test that would show he was able to lead the Bnei Yiroel in Eretz Yisroel where they would need to live Al Pi Derech Hateva and therefore disqualified himself from entering Eretz Yisroel.