"Because you did not believe in Me, etc." (Numbers 20:12). I told you that you should speak to the rock in My name, and it would give forth its waters. And had you done so, I would have been sanctified in the eyes of the Children of Israel, and they would have feared Me, for they would have said: "If the rock carried out His word, how much more so should we!" But because you did not do so, therefore you shall not bring this congregation [into the land].
Why Moses Was Barred from the Land at the Rock
Midrash Aggadah, Numbers 20:12
יען לא האמנתם בי וגו'. אני אמרתי לכם שתדברו אל הסלע בשמי והיא תתן מימיה, ואם הייתם עושים כך הייתי מקודש לעיני בני ישראל ויראו מפני, שיאמרו ומה הסלע עשה דברו אנו על אחת כמה וכמה, ולפי שלא עשיתם כן, לכן לא תביאו את הקהל הזה: