Bemidbar 20:2-13 record the people's complaint for water and the ensuing “sin” of Moshe and Aharon that caused them to be punished that they would not make it to the land of Israel. What was Moshe's and Aharon’s sin? For various reviews of this question, see Ibn Ezra on 20:8, Abravanel, 2008, pp. 167-176, and N. Leibowitz, 1982, pp. 236-247. I will review some of the explanations of the "sin" and offer two possible explanations.
I believe the most popular explanation is Rashi's explanation (on 20:11,12) that Moshe was supposed to speak to the rock, 20:8, but instead Moshe hit the rock, 20:11. The idea of speaking to the rock is understood to mean that Moshe was supposed to give an order to the rock to exude water, for example to say to the rock "give the people water." This approach has raised various questions.
The Ramban (on 20:7) criticizes Rashi's approach. He notes that 20:12 records that Moshe and Aharon showed a lack of faith in G-d, lo heehmanetem, but how did Moshe show a lack of faith in G-d by hitting the rock instead of speaking to the rock? When Moshe hit the rock he had faith that water would flow from the rock. It could be that Moshe was not following G-d's command (according to Rashi) and that the miracle would have been more impressive if Moshe had spoken and not hit the rock, but still Moshe did not demonstrate any lack of faith in G-d. The Ramban also notes that Moshe spoke about the rock, 20:10, which he argues was the fulfillment of G-d's command to Moshe to speak to the rock.
Abravanel attempts to answer the Ramban's question by arguing that hitting the rock instead of speaking to the rock was not the real source of Moshe and Aharon’s punishment, but rather Moshe and Aharon were being punished for previous sins. Aharon was punished for his role in building the golden calf. Moshe was punished for requesting more information from the spies than what was needed and it was the spies' answers to these questions that caused the people to refuse to enter the land of Israel. Abravanel claims his approach explains why in Devarim 1:37 Moshe mentioned his punishment in conjunction with the sin of the spies since his real sin was by the sending of the spies. Also, this approach appears to explain why Aharon was punished here even though he had almost no role here.
The Abravanel's approach is appealing but not convincing since 20:24 states that Aharon sinned here as well, and thus he was not being punished for his role in the sin of the golden calf. Similarly, as Rashi (on 20:12) points out that the sense of 20:12 is that Moshe was being punished for his action here not for something many years earlier. Also, I do not think that Moshe sinned in any way by the sending of the spies, see our discussion on 13:1,2,26, "A test" http://lobashamayim.blogspot.co.il/2009/06/bemidbar-131-20-shelah-test.html.
A different answer is that the words lo heehmanetem in 20:12 does not mean that you showed a lack of faith, but that you were not steadfast, see Shemot 17:12. (I heard this idea from Nathaniel Helfgot.) The idea being that Moshe was not steadfast in listening to G-d, but not that Moshe evidenced any lack of faith here.
Another question on Rashi's approach is how could Moshe have misunderstood what G-d told him to do? Luzzatto (end of comments on 20:12) suggests that the misunderstanding was because Moshe was angry, but still it seems problematic to say that Moshe misunderstood G-d's command to speak to the rock.
A third question on Rashi's approach is why was Aharon punished here? Aharon did not speak to the rock, but did he have a chance to do so? 20:10 records that Moshe spoke to the people, said rhetorically could the rock exude water and then Moshe hit the rock. Was Aharon supposed to jump in and shout "exude water" to the rock?
I think the Ramban in correct that Moshe's statement in 20:10 about the rock with Aharon standing next to him was the fulfillment of G-d's command to him and Aharon in 20:8 to speak to the rock. What then were their sins?
One possibility is that after Moshe made his statement in 20:10 he was supposed to wait until the water started to gush from the rock, but he got impatient and he hit the rock twice. This impatience was the lack of faith since the water was going to go forth in a few more seconds. Aharon's sin here was that he did not stop Moshe from hitting the rock. 20:11 records that Moshe raised his arm to lift his staff to hit the rock and at the time, Aharon could have grabbed Moshe's arm and stopped him from hitting the rock. Moshe even hit the rock twice, and my son Binyamin believes that this means that Moshe raised his arm a second time, which would have given Aharon a second chance to stop Moshe from hitting the rock. (Note this idea could also be Aharon's sin if one believes that the sin was not ordering the rock to exude water, Rashi's approach.)
With this possibility, while Moshe was told to take the staff, 20:8,9, this was just to point out the rock when he spoke in 20:10, but he was not supposed to use it to hit the rock. However, one could argue, as the Ramban does, that when Moshe was commanded to take the staff, this meant that he was supposed to both speak about the rock and to hit the rock. If this is true, then maybe there is another possible "sin."
Luzzatto (on 20:12) has a lengthy review of Moshe's "sin" and he begins with a disclaimer that for many years he did not try to examine this question since he did not want to add another sin to Moshe. Instead, initially he accepted Moshe Mendelssohn’s (1729-1786, Germany) approach that the sin was Moshe and Aharon's reaction to the people when the people complained for water that Moshe and Aharon ran away from the people, 20:6, also see Ibn Ezra on 20:6. Luzzatto notes that three other commentators (R. Avraham ben Shem Tov Bibago, Spain 15th century, Derekh Emunah; R. Avraham Menachem ben Jacob haKohen Porto, Verona, 16th century, Minhah Belulah; and the book Avat Nefesh a commentary on Ibn Ezra) also followed this approach.
After quoting these other commentators, and noting that he taught their explanation for 15 years, Luzzatto rejected it for the following reasons. One, G-d did not criticize Moshe and Aharon for not speaking to the people, but for showing a lack of faith. Two, the statement in the Torah words that “you (Aharon) rebelled against Me,” 20:24, implies that Moshe and Aharon did not do something that they were commanded. Three, the language in the Torah that Moshe and Aharon left the people, 20:6, does not imply that they ran from the people.
Luzzatto writes that he now accepted Rashi’s explanation that the sin was they were supposed to speak to the rock, but a variation of the idea of the four commentators that the "sin" was Moshe and Aharon's reaction to the people's demand for water could answer Luzzatto's questions.
Was the people’s complaint about water justified? The traditional explanation (see Rashi on 20:2) for the people’s complaint for water is that previously they had been getting water from a well which traveled with the people, but after Miryam died, the well disappeared. With this explanation, the complaint of the people would seem to be justified since they truly needed water to live (see Hizkuni on 20:2). Yet, why then was the people’s complaint considered a fight against G-d (20:13)? Also after Miryam died, how were the people supposed to get water, as the incident here appears to be a onetime event?
As we discuss on 20:2-5 "Water in the desert," (http://lobashamayim.blogspot.co.il/2009/06/bemidbar-202-5-hukkat-water-in-desert.html) my understanding is that the mahn was able to supply the people with all their nutritional needs in the desert, both solids and liquids. I doubt there was a well that traveled with the people since it is never mentioned in the Torah, but even if there was a well and it disappeared after Miryam died, the people did not need regular water. Thus, the peoples' complaints for water in 20:5 and 21:5, were unjustified, and maybe this understanding offers a new perspective on Moshe's and Aharon's "sin."
The people stated that they were going to die in the desert and that they never should have left Egypt, 20:3-5. This was a denial of G-d’s goodness to them, and hence the Torah calls it a rebellion against G-d, 20:13. Moshe and Aharon should have told the people that they were not going to die because they would live by eating the mahn. It is possible that the people were so worked up, that they would not have listened to Moshe and Aharon, but then Moshe and Aharon should have ignored the people’s complaint for water. (Note by the sin of the spies, Moshe and Aharon did not run to the ohel moed, but fell on their faces before the people, 14:4.)
When Moshe and Aharon went to G-d after hearing the people's complaint for water, this gave the impression that they were going to ask G-d to give the people water, which implied that Moshe and Aharon accepted the people’s complaint. Thus, when Moshe and Aharon went to the ohel moed it was a partial negation of the great miracle of the desert, the mahn. If Moshe and Aharon gave the impression that they were even just partially negating the miracle of the mahn then this would be considered as showing a lack of faith in G-d. Note this still seems like a small sin since Moshe and Aharon were trying to help the people, but for both Moshe and Aharon this was their second sin, as Moshe already sinned in 11:21-23 and Aharon sinned by the golden calf. In addition, if Moshe and Aharon gave the impression that they were praying for the people to get water then in some sense they were joining the people’s fight with G-d. This could then be considered as rebelling against G-d, and this would explain the language in 20:24 (also see 27:14), that “you (Aharon) rebelled against Me.”