Dvar Torah by Rabbi Zelig Pliskin
The Almighty told Moshe that he would not be allowed to enter the land of Israel: “…because you trespassed against me in the midst of the Children of Israel at the waters of Merivos-Kadesh, in the wilderness of Tzin, because you did not sanctify Me in the midst of the Children of Israel” (Deuteronomy 32:51).
The verse seems to be redundant.
Rabbi Meir Simcha HaCohen explains that the concept of din (judgment) and cheshbon (accounting) are being referred to in this verse. Din is the judgment for what one has done wrong – Moshe trespassed against the Almighty. The second part of the verse is the cheshbon, that is, the calculation of what Moshe could accomplish if he would have done what was proper by speaking to the rock instead of hitting it. He would have had the merit of a major Kidush HaShem, sanctification of G-d’s name instead of “you did not sanctify Me.”
Our lesson: Before we act, we must consider the possible harm of our action as well as the lost opportunity for accomplishing something positive.