My father once said, "Sin is doing the right thing at the wrong time." This certainly rings true for Moshe.
For 40 years, he was commanded by God to hit rocks whenever his nation needed water. Now, 40 years later, the rules change. He, now, must speak to the rock instead. Habits prove hard to break. When Moshe, once again, hits the rock the consequences are harsh and immediate. He is barred from entering the Promised Land and must perish in the wilderness.
How does an act that was good for 40 years suddenly become so egregious?
Leadership is about knowing the shifting sands of time. One of the central roles of a leader is to understand when to speak and when to hit. A new generation emerged who needed to be inspired by words and ideas. Instead they received an old approach that didn't resonate. Life wasn't designed for cruise control. Every "right thing" needs the "right time."