I used to think this was a bit extreme on God's part. All Moses did was hit a rock. But I reread this passage and the one in Numbers 20 where God had also brought water forth from the rock and I saw the problem. See the first time, God told Moses to hit the rock and water would flow out to quench the Israelites thirst (and it must have been like a river because there were LOTS of people and animals, I means LOTS).
Moses did a good job that first time. He did it exactly how God told him to do it and Moses gave God the glory. The people were pointed to God through the miraculous provision of water.
The second time God told Moses and Aaron to speak to the rock, not hit it. But Moses was angry this time and he let his anger control him. The people were complaining again about him and God. They were accusing Moses of horrible things when Moses had given his life to these people. So when God told him to speak to the rock he hit it twice and also said he did it (gave them water). Moses took the credit out of his anger.
God still did the miracle, but Moses was no longer allowed to lead the people into the promised land. He let his anger lead. He didn't treat God as holy. He had been closer to God than anyone. God spoke to him as a friend. His relationship with God was tight and miraculous, but in that moment Moses let his anger lead and betrayed God.
I went back and read that Numbers 20 and kept reading into the next chapter and saw something I had underlined in Numbers 21:4. It says, "The people became impatient with their journey."
So, what happened? They let this frustration lead them into sin. Many died. It was awful.
We have to be so careful with our emotions. They are not bad or good. They just are. In the best sense they can be great blessings. They can be used for God's kingdom. They can add incredible joy to our lives. They can color everything in a beautiful way.
For them to function like this in our lives, we must use them rather than them using us. If we let our emotions control us we are not grounded.
Emotions are meant to be huge blessings. But if they are running our lives they are a curse to us (and to everyone who knows us).