The focal verse for a set of general charges:
Matthew 5:22 "Whosoever shall say Thou fool, shall be in danger of hellfire."
This is set against several verses; let's look at them one at a time. We need to begin by quoting Matthew 5:22 in entirety:
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.
It is obvious here that Jesus is talking in 5:22 about relations with one's brother (not physical brothers, of course, but fellow believers) and about words said in anger to that brother. Thus in reply to other passages:Matthew 23:17 "Ye fools and blind." Psalm 14:1 "The fool hath said in his heart, There is no God."
In Matthew 23:17, Jesus is not talking to his brethren, but to the Pharisees. In line with the verse in Psalms, he was referring to the Pharisees as unbelievers (in His own work, of course). This also means that the OT verse does not apply here.
There is also this passage:
Luke 11:40 You foolish people! Did not the one who made the outside make the inside also?
The same point applies, but we will add here that the word for "foolish" in Luke is a different Greek word than the one in Matt. 5:22. (aphron vs. moros). The former word is also used by Paul in 1 Cor. 15:36. It has more of a connotation of "unbeliever" than it does a reference to just "plain stupidity" as moros has.
Skeptics may of course go on to object that this is offensive anyway, even without the contradiction, but the polemic registered here is no more than within the range of stock accusations made among various parties in Judaism, which were perfectly acceptable in this time period. Skeptics may not impose their modern values upon peoples of the past for whom such exchanges of rhetoric were stock-in-trade -- it is no more offensive in this context than modern men "playing the dozens."