This question already has an answer here:
- Lesson from Moshe's Rock 4 answers
Rashi's explanation for what Moshe's sin was in Numbers 20 when he hit the rock is
להקדישני. שֶׁאִלּוּ דִּבַּרְתֶּם אֶל הַסֶּלַע וְהוֹצִיא, הָיִיתִי מְקֻדָּשׁ לְעֵינֵי הָעֵדָה, וְאוֹמְרִים מַה סֶּלַע זֶה שֶׁאֵינוֹ מְדַבֵּר וְאֵינוֹ שׁוֹמֵעַ וְאֵינוֹ צָרִיךְ לְפַרְנָסָה, מְקַיֵּם דִּבּוּרוֹ שֶׁל מָקוֹם, קַל וָחוׂמֶר אָנוּ:
If you had spoken to the rock and brought out [the water], I would have been sanctified in the eyes of the congregation. They would have said "just like this rock, which doesn't speak and doesn't hear and doesn't need sustenance, listens to the word of the Omnipresent, all the more so should we!"
The problem with this kal vachomar is it has a פירכה, refutation. To use talmudic language: מה לסלע, שאין לה בחירה חפשית, תאמר בבני אדם שיש להם בחירה חפשית. How can we learn from a rock, which doesn't have free will, we have free will! Obviously the rock listens to Hashem, it has no choice. Why should that mean I have to?