From Anger, Midos, and the Afterlife (#447) by Rabbi Avigdor Miller
You remember when Moshe Rabbeinu came down from receiving the aseres hadibros (Ten Commandments) and he heard the noise of dancing and singing. He discovered they made a golden calf, and he became so angry that he took the tablets of stone and he hurled them down and smashed them to pieces.
Hakadosh Baruch Hu later said to him, “Asher shibarta — which you shattered”; meaning yashar koach sheshibarta, it’s good you did that, smashing them to pieces! It was a lesson to the people. The people were shocked, they were stunned. They were all waiting to receive the aseres hadibros from Hashem Himself, the stone tablets. And then, “Ashabreim l’eineichem — I broke them before your eyes.” That cooled them off from the happiness, from the joy, the celebration around the golden calf.
Anger is cursed only when it’s used for the wrong things
And then Moshe Rabbeinu said “Mi l’Hashem eilai — whoever is for Hashem should come to me.” Who came to him? Only the angry ones. “V’yeisasfu eilav kol bnei Levi — The bnei Levi gathered around him.” You know bnei Levi were the angry ones; Yaakov our father had cursed their anger: “Shimon v’Levi achim arur apam — Cursed is their anger.” He cursed their anger. But it’s cursed only when it’s used for the wrong things.
When they came together and they rallied to the cry of Moshe Rabbeinu, who was for Hashem, all the bnei Levi came — Here we are! Moshe said, Each one gird your sword on your loins and you should execute everyone who worshipped the golden calf. Three thousand were executed at that time. It says at that time Hashem chose the shevet (the tribe of) Levi. He chose them and He said They’re going to serve Me forever.
So we see that anger can make people great when it’s employed in the right time.