The story of Moshe hitting the rock in Parashat Chukat (BeMidbar 20:1-13) is one of the most cryptic stories in the entire Torah. When the Jews complain about a lack of water after their well stops working, saying that they’d rather be back in Egypt, God tells Moshe to take his staff and speak to a rock; the rock will then become a well. Moshe takes his staff and goes to the rock, but instead of speaking to it as God commanded him, he hits the rock. The rock does indeed become a well, but God is furious at Moshe for disobeying Him and punishes Moshe never to enter the land of Israel.
There are so many questions that can be asked about this story. 1) Why does God tell Moshe to speak to the rock? 2) Why does Moshe hit the rock instead? 3) Considering that Moshe’s hitting of the rock does produce the desired result, what is so bad about it? 4) How does the punishment of not being able to enter Israel fit the crime of hitting the rock?
In order to answer all of these questions, we must first understand the reason to hit a rock in the first place. As it turns out, Parashat Chukat is not Moshe’s first experience with creating a rock-well to silence a complaining Jewish nation; the exact same scenario appears forty years earlier in Parashat BeShallach (Shemot 17:1-7). However, there, Moshe is commanded to hit the rock with his staff, not speak to it.
And the staff he uses is not any old staff. When commanding Moshe to hit the rock in Parashat BeShallach, Hashem specifies “Matecha Asher Hikita Bo Et HaYe’or Kach BeYadecha,” “Take in your hand your staff that you used to hit the Nile River,” (Shemot 17:5) i.e. the staff that Moshe (and his brother Aharon) used to carry out the Ten Plagues in Egypt. But why is this detail mentioned? Why did Moshe need specifically this staff to hit the rock?
I believe that, in Parashat BeShallach, Moshe was required to hit the rock with the exact same staff he used for the Ten Plagues because the Ten Plagues and the hitting of the rock had the same purpose: to display the power of God through a show of force. The Jews had become rebellious — they complained about leaving the land of their servitude and even caused Moshe to fear for his life (Shemot 17:4)! They needed to be reminded that the powerful God who had taken them out of Egypt was still with them, an Almighty God who could perform awesome miracles at any time. Therefore, Moshe was commanded to take the very same staff he used to perform those miracles and to perform another show-of-force miracle. This new miracle was to be done the very same way as Ten Plagues; just as Moshe used the staff to hit the Nile River in Egypt, he is commanded to use the staff to hit the rock in Parashat BeShallach. This reminds the people of the Ten Plagues and reaffirms their belief and respect for God.
Moshe’s mistake in Parashat Chukat is doing the exact same thing. The situation is the same: the Jews complain that there is no water and that they would be better off in Egypt. Moshe figures that since the complaint is the same as forty years earlier, the miracle should be done the same as well. Moshe thinks that he should once again hit the rock with the staff and perform a show-of-force miracle to remind the Jews of the Ten Plagues.
What Moshe fails to understand is that this is the beginning of a new era for the Jews. The entire generation of Jews that left Egypt is gone; they all died in the forty years between the first rock-hitting and the second. This new generation did not witness the Ten Plagues or the Splitting of the Sea. Moreover, they are about to enter the Land of Israel, a place where miracles will not spring up left and right as they had during the Exodus from Egypt. There will still be miracles, but they will exist primarily to help the Jews defeat their enemies, not just to showcase the power of God, and the people who want these miracles will need to play some part themselves. For example, if Yehoshu’a wants the walls of Yericho to fall down, he and the Jews will need to march around the city thirteen times, blowing Shofar, and they will need to promise to consecrate all the city’s wealth to God (Yehoshu’a 6:1-25). If Yiftach wants God to help him defeat the Ammonites, he needs to promise to dedicate to God the first thing to come out of his house when he returns victorious. And then actually fight the Ammonites (Shofetim 11:30-33). Miracles in Israel will occur only to fulfill specific needs and only if the beneficiaries of those miracles do something to deserve them. The time of “Hashem Yilacheim Lachem VeAtem Tacharishun,” “Shut up, God will fight on your behalf” (Shemot 14:14) is over.
The second story of the rock-well in Parashat Chukat is somewhat of a test for Moshe. Can Moshe adapt to the practical, hard-earned miracles of Israel, or will he forever be stuck in the Yetziat Mitzrayim world of effortless show-of-force miracles? The second miracle of the rock-well is a transitionary miracle of sorts. As Bnei Yisrael stand on the precipice of Eretz Yisrael, Moshe is commanded to bring the miracle staff to the rock but specifically not to use it, instead using his words (effort) to get water (an essential need). If Moshe is able to do this, he will have proven his worth to lead the Jews through the transition into the land of need-based, effort-intensive miracles, Israel.
But Moshe Rabbeinu does not do that. Enraged by the Jews’ lack of faith in God, he believes that a show-of-force miracle is required to remind them of the Exodus and reaffirm their belief. Moshe does not change his ways to perform the types of miracles that will be done in Israel. Moshe led the Jews for forty years with the former type of miracle and could not or would not change to acclimate himself to the latter type.
In summation, Moshe fails the test of the rock because he is part of the old guard and is unable or unwilling to change his style. So logically, a younger man from the new generation should be chosen to succeed Moshe and lead the Jews into Israel.
But curiously, this is not what happens. Moshe’s successor is Yehoshu’a, who, despite being several decades younger than Moshe Rabbeinu, is definitely part of the old generation. Yehoshu’a was an adult when he left Egypt, and he witnessed the era of the Ten Plagues, the Splitting of the Sea, and other effortless, power-showcasing miracles just as Moshe did.
So why is Yehoshu’a a better choice than Moshe to lead the Jews into the land of practical miracles? He should experience the same problems as Moshe!
But he does not, because Yehoshu’a has a different personality than Moshe, a personality that makes him more amenable to transitioning to effort-driven miracles than Moshe. Nowhere is this distinction between Moshe and Yehoshu’a more clear than in the story that immediately follows the first story of the rock-well in Parashat BeShallach: the attack of Amalek (Shemot 17:8-16). When Amalek attacks, Moshe takes his miracle staff and raises his hands towards heaven, causing the Jews to win — a classic show-of-might miracle. Yehoshu’a, on the other hand, gathers men and leads the actual sword-to-sword battle against Amalek. He is the one who provides the effort necessary to make the miracle work. Moshe is the greatest prophet who ever lived, but Yehoshu’a is the man most fit to lead the Jews into the Land of Israel.
We see from this that everybody has a different role in life, and even someone who remains a subordinate for years or decades will find a time when his or her skills are greatly needed.
 In fact, the two situations are so similar that the Bechor Shor writes that the story happened only once but was recorded in two separate places. This is not the simple understanding of the Pesukim, but it is a fascinating idea.
 Technically, it was Aharon who hit the Nile, but the Pasuk refers to Moshe.