Rav Hirsch states that Moshe is to take the mateh in order to show that he is acting as the messenger of Hashem. However, hitting the rock with the mateh would imply that this is a special intervention from Hashem as a result of the uproar. Moshe is to take the staff "show them that you are still my messenger", but speak to the rock to show that it was Hashem who led them here and
... the required water was already provided by Hashem at the place to
which He had directed them, and it merely required a word from Moshe
and Aharon to the rock which would suffice for it to produce the water
which Hashem had placed ready for them
... without any fresh miracle, simply with a word from you, you are to
provide them with a sufficiency for their undeniably present
requirements.
This manner of obtaining the water would have convinced the people of
the deep wrong they had done in accusing Moshe and Aharon of leading
them to this waterless place against the will of Hashem; whereas water
gushing forth only as a result of a blow could still leave room for the
assumption that their having been led into the wilderness of Tzin was
originally a wilful arbitrary act on the part of Moshe and Aharon and
only subsequently their justified revolt and their pressing need
brought about the merciful miracle of Hashem.
Note that the first time in Beshalach he was instructed to hit the rock to show that this was an explicit miracle by Hashem just as the makos in Mitzraim or the splitting of the Yam Suf which also used the mateh.
Rabbi Sorotzkin in Oznayim Latorah states that the speaking actually was not to the rock but was to teach the Bnai Yisrael Torah and to raise their spiritual level to the point that they would have deserved the miracle of the water coming from the rock themselves (with no further action by Moshe). Moshe was to take the mateh as a "Plan B" only if Bnai Yisrael could not reach that level. The error was that he concluded that Bnai Yisrael could not be raised to that level and he required the explicit miracle of hitting the rock. This should have been delayed until after he had attempted to raise the Bnai Yisrael to that level.
Note that this also explains why Moshe Rabbeinu was instructed to hit the rock in Beshalach, since they were not yet at the higher level.
an amazing yalkut shimoni on the sin of mei meriva
Not to be missed among the many views of what Moshe did wrong at Mei Meriva is the opinion of Yalkut Shimoni (remez 564):
יען לא האמנתם בי ארבע חטאות כתובין כאן לא האמנתם, לא קדשתם, מעלתם, מריתם, לא האמנתם שלא אמרתי לכם להכות והכית אותו. ולא קדשתם לעיני כל ישראל להוציא להם מים מכל סלע שרוצים, מעלתם אמרת המן הסלע הזה, מריתם ודברתם אל הסלע שנה עליו פרק אחד ועברת על דברי.
The sin of “not speaking” according to the Yalkut does not mean not
ordering the rock to produce water, but rather refers to the sin of
not studying Torah near the rock. Moshe should have responded to the
demand for water by sitting and learning! Hitting the rock to produce
water undoubtedly demonstrated Hashem’s miraculous power, but it did
not demonstrate the power of Torah, and it was for that specific
crucial failing that Moshe was blamed.
the Hafla'ah on Moshe's sin -- mei meriva
We once discussed here the amazing Chazal that says the “dibartem el
ha’sela” that Moshe was supposed to do instead of hitting the rock was
to learn Torah. Chasam Sofer (brief version here at the end of Shu”T
E”H 121, longer version in his commentary on chumash) adds another
dimension to this interpretation that he heard from the Hafla’ah.
Chazal interpret the complaint of thirst in Parshas Beshalach as not
just a thirst for water, but as a thirst for Torah; the takana of
kri’as haTorah on Monday/Thursday was a response to this need. No
longer would there be “va’yelchu shloshes yamim b’li mayim;” no longer
would there be three days without public learning.
The episode of mei meriva in our parsha occurred right after the death
of Miriam. It was in her zechus that there was a well in the desert;
with her death, the well vanished. The thirst of the people returned,
but again, it was not just a thirst for water, but a thirst for Torah
as well. However, this time around Moshe and Aharon were in aveilus
for their sister. They could not learn torah or teach Klal Yisrael!
“Lu gavan’u b’gva acheinu lifnei Hashem,” the people complained – had
we died earlier, it would at least have been “lifnei Hashem,”
enveloped by ruchniyus; now, we have nothing.
The Midrash says the sin of Moshe and Ahraon was not learning even one
perek or one halacha to satisfy their needs. Explains the Hafla’ah,
they could have learned perek “eilu megalchin; they could have learned
a din in hilchos aveilus. There is never a need or an excuse to
completely abandon learning.
The Chasam Sofer (al haTorah) adds his own two cents to this idea.
Why in the earlier episode of thirst in Parshas Beshalach was Moshe
commanded to hit the rock but this time he was told to speak to it?
There are different ways to combat the yetzer ha’ra. One way is the
brute force method – crush it into oblivion. That method is
symbolized by the hitting of the rock that took place shortly after
yetzi’as Mitzrayim. Forty years later a more mature Bnei Yisrael was
ready to appreciate another approach to combating the yetzer –
“mashcheyhu l’beis ha’medrash,” redirecting its energy to a positive
goal. Moshe was supposed to engage in talmud torah to demonstrate
that the stubborn rock could be harnessed for good as well.