"For I say to you that unless your righteousness surpasses that of the scribes and Pharisees, you will not enter the kingdom of heaven. "You have heard that the ancients were told, ' you shall not commit murder ' and 'Whoever commits murder shall be liable to the court.' But I say to you that everyone who is angry with his brother shall be guilty before the court; and whoever says to his brother, ' You good-for-nothing,' shall be guilty before the supreme court; and whoever says, 'You fool,' shall be guilty enough to go into the fiery hell. [Matthew 5:20-26 NASB]The Pharisees were so righteous that they not only observed the letter of the Law, they added to it with oral tradition. Jesus said that was not enough. You must observe the Law of Righteousness in your heart.
The first example of this that Jesus gives is the command, "you shall not commit murder."
In the kingdom of God, unbridled anger is equated with murder. If you murder someone in your heart, you are as guilty as if you had murdered them in the flesh. We are further told by Paul, "Now the deeds of the flesh are evident, which are:...outbursts of anger...and things like these, of which I forewarn you, just as I have forewarned you, that those who practice such things will not inherit the kingdom of God." [Galatians 5:19-21 NASB]
Having said that, we are also told, "be angry, and yet do not sin; do not let the sun go down on your anger." [Ephesians 4:26 NASB] God gave us the emotion of anger, and knows that we will get angry. But we can be angry without sinning. Don't hold on to anger so that it grows into wrath. If you hold onto anger, it becomes sin.
And be careful with your words. I picture a cart being pulled by a donkey in ancient Israel. Another man comes along with a donkey and cart and cuts him off. The first cart owner raises his fist and says "Raca (You good for nothing)". In contemporary society, if we are cut off by another car, we might say, "You idiot, moron, imbecile, fool." By allowing anger to burst out of us in words, we condemn ourselves.
Jesus Himself became angry. He was in the synagogue on the Sabbath when He saw a man with a withered hand, "And He said to them, “Is it lawful to do good or to do harm on the Sabbath, to save a life or to kill?” But they kept silent. After looking around at them with anger, grieved at their hardness of heart, He said to the man, “Stretch out your hand.” And he stretched it out, and his hand was restored." [Mark 3:4-5 NASB]
When Jesus overturned the tables of the money changers in the temple, it's hard to imagine that He did so without being angry. His anger was directed at hypocrisy. He was angry with those who claimed to represent God, yet caused His name to be slandered.
The fact that Jesus felt the emotion of anger is not an excuse for us to indulge in anger. Right after saying "be angry, and yet do not sin," Paul went on to tell us, "Let all bitterness and wrath and anger and clamor and slander be put away from you, along with all malice." [Ephesians 4:31 NASB]
Don't be quick to claim "righteous indignation" over a perceived sin. I have been guilty of that, when I was actually just being judgmental. As God, Jesus can rightly claim "righteous indignation" because He can truly judge the heart of a man. We cannot. If we become angry, we need to let it go so that we do not sin, "for the anger of man does not achieve the righteousness of God." [James 1:20 NASB]