But what exactly was the sin he committed?
Maimonides thinks it is Moses’ display of anger. Nachmanides thinks the problem was in saying, “Are we (Aaron and I) to bring forth water for you?” when it was really God who would (or would not) bring forth water and Moses and Aaron were merely His Divine messengers.
Eliyahu Mizrachi, a famous commentator on Rashi, points out that because Moses had been a shepherd he must have known enough geology to recognise which rock to hit if he needed water. The fact that he put his scientific knowledge into effect by hitting a rock when he was told to speak to it brought water, but it prevented a miracle from happening.
He should have left it to God to make the water flow as the result of speaking to the rock. In preventing the miracle he showed that his trust in God was lacking.
It is inexcusable when a religious leader doesn’t give God a chance.