Because they provoked his spirit, so that he spoke rashly with his lips.
Read Chapter 106
Augustine of Hippo
AD 430
26. "And they angered Him at the waters of strife: so that Moses was vexed for their sakes" (ver. 32); "because they provoked his spirit, so that he spake doubtfully with his lips" (ver. 33). What is spake doubtfully? As if God, who had done so great wonders before, could not cause water to flow from a rock. For he touched the rock with his rod with doubt, and thus distinguished this miracle from the rest, in which he had not doubted. He thus offended, thus deserved to hear that he should die, without entering into the land of promise. For being disturbed by the murmurs of an unbelieving people, he held not fast that confidence which he ought to have held. Nevertheless, God giveth unto him, as unto His chosen, a good testimony even after his death, so that we may see that this wavering of faith was punished with this penalty only, that he was not allowed to enter that land, whither he was leading the people. ...
He distinguished with his lips. Moses, by occasion of the people's rebellion and incredulity, was guilty of distinguishing with his lips; when, instead of speaking to the rock, as God had commanded, he said to the people, with a certain hesitation in his faith, Hear ye rebellious and incredulous: Can we from this rock bring out water for you? Numbers xx. 10. (Challoner)
For thus doubting of God's will, he was temporarily punished, Deuteronomy i. 37. (Worthington)
The death of his sister, and the ingratitude and rebellion of the people disturbed him. (Theodoret) See Isaias lxiii. 10. Houbigant follows the Arabic, "he delayed or hesitated. "Yebatte means, "he spoke rashly. "Some refer this, (Berthier) to God. "He reproached. That they", (Menochius) which is not necessary, (Berthier) or he sentenced Moses to die. (Kimchi)