Psalm 14:1 The fool hath said in his heart, There is no God. They are corrupt, they have done abominable works, there is none that doeth good.
Matthew 5:22 But I say unto you, That whosoever is angry with his brother without a cause shall be in danger of the judgment: and whosoever shall say to his brother, Raca, shall be in danger of the council: but whosoever shall say, Thou fool, shall be in danger of hell fire.
Why is it OK to call a fool a fool in the Old Testament but not in the New Testament?
Translations are tricky. These are two different words and two different meanings. On the face of it they sound the same but if you get back to the origins, there is a great difference.
The Hebrew word for fool in Psalm 14 speaks to behavior, meaning foolishness. The Greek word for fool in Matthew 5 means godless.
While Psalm 14 was referring to the action and thoughts of others, Jesus was speaking to believers about our thoughts and actions. Anger without cause and the resentful outburst Raca are emotional and we should know that a pricking of the conscience is coming. The Holy Spirit will chasten our behavior.
Calling another person godless is likened to blasphemy. It is God who saves. If we are to imply to anyone that they are beyond salvation, we are setting ourselves up not just as a judge but one who can determine salvation. This is not within our ability or responsibility.
The bible does not contradict itself. If you think it does, then look for the differences. Its there.