Tradition

Catholicism teaches the Scribes and Pharisees were right in their doctrine and teachings, and that their flaw was in not following what they said - a mistaken interpretation of Matthew 23:3 ("All therefore whatsoever they bid you observe, that observe and do; but do not ye after their works: for they say, and do not.").

Pharisaical Doctrine Was Leaven to be Avoided
However, Jesus indeed warned against following the doctrine of the Pharisees, calling it leaven to be avoided:

Matthew 16:6-12 Then Jesus said unto them, Take heed and beware of the leaven of the Pharisees and of the Sadducees. And they reasoned among themselves, saying, It is because we have taken no bread. Which when Jesus perceived, he said unto them, O ye of little faith, why reason ye among yourselves, because ye have brought no bread? Do ye not yet understand, neither remember the five loaves of the five thousand, and how many baskets ye took up? Neither the seven loaves of the four thousand, and how many baskets ye took up? How is it that ye do not understand that I spake it not to you concerning bread, that ye should beware of the leaven of the Pharisees and of the Sadducees? Then understood they how that he bade them not beware of the leaven of bread, but of the doctrine of the Pharisees and of the Sadducees.

Wrong Traditions
It was the Jewish Pharisees, the religious leaders, who were condemned for traditions focusing on the external, the flesh, rather than the heart and spirit:

Mark 7:1-23 Then came together unto him the Pharisees, and certain of the scribes, which came from Jerusalem. And when they saw some of his disciples eat bread with defiled, that is to say, with unwashen, hands, they found fault. For the Pharisees, and all the Jews, except they wash their hands oft, eat not, holding the tradition of the elders. And when they come from the market, except they wash, they eat not. And many other things there be, which they have received to hold, as the washing of cups, and pots, brasen vessels, and of tables. Then the Pharisees and scribes asked him, Why walk not thy disciples according to the tradition of the elders, but eat bread with unwashen hands? He answered and said unto them, Well hath Esaias prophesied of you hypocrites, as it is written, This people honoureth me with their lips, but their heart is far from me. Howbeit in vain do they worship me, teaching for doctrines the commandments of men. For laying aside the commandment of God, ye hold the tradition of men, as the washing of pots and cups: and many other such like things ye do. And he said unto them, Full well ye reject the commandment of God, that ye may keep your own tradition. For Moses said, Honour thy father and thy mother; and, Whoso curseth father or mother, let him die the death: But ye say, If a man shall say to his father or mother, It is Corban, that is to say, a gift, by whatsoever thou mightest be profited by me; he shall be free. And ye suffer him no more to do ought for his father or his mother; Making the word of God of none effect through your tradition, which ye have delivered: and many such like things do ye. And when he had called all the people unto him, he said unto them, Hearken unto me every one of you, and understand: There is nothing from without a man, that entering into him can defile him: but the things which come out of him, those are they that defile the man. If any man have ears to hear, let him hear. And when he was entered into the house from the people, his disciples asked him concerning the parable. And he saith unto them, Are ye so without understanding also? Do ye not perceive, that whatsoever thing from without entereth into the man, it cannot defile him; Because it entereth not into his heart, but into the belly, and goeth out into the draught, purging all meats? And he said, That which cometh out of the man, that defileth the man. For from within, out of the heart of men, proceed evil thoughts, adulteries, fornications, murders, Thefts, covetousness, wickedness, deceit, lasciviousness, an evil eye, blasphemy, pride, foolishness: All these evil things come from within, and defile the man.

Matthew 23:23-32 Woe unto you, scribes and Pharisees, hypocrites! for ye pay tithe of mint and anise and cummin, and have omitted the weightier matters of the law, judgment, mercy, and faith: these ought ye to have done, and not to leave the other undone. Ye blind guides, which strain at a gnat, and swallow a camel. Woe unto you, scribes and Pharisees, hypocrites! for ye make clean the outside of the cup and of the platter, but within they are full of extortion and excess. Thou blind Pharisee, cleanse first that which is within the cup and platter, that the outside of them may be clean also. Woe unto you, scribes and Pharisees, hypocrites! for ye are like unto whited sepulchres, which indeed appear beautiful outward, but are within full of dead men's bones, and of all uncleanness. Even so ye also outwardly appear righteous unto men, but within ye are full of hypocrisy and iniquity. Woe unto you, scribes and Pharisees, hypocrites! because ye build the tombs of the prophets, and garnish the sepulchres of the righteous, And say, If we had been in the days of our fathers, we would not have been partakers with them in the blood of the prophets. Wherefore ye be witnesses unto yourselves, that ye are the children of them which killed the prophets. Fill ye up then the measure of your fathers. Ye serpents, ye generation of vipers, how can ye escape the damnation of hell?

The Flaw of Externalism
They have fallen to the flaw of externalism, focusing on the outside rather than the inside, the heart, spirit, and soul. As God told Samuel over a thousand years before Jesus came, God does not look on the outside as men do, but on the heart.

1 Samuel 16:7 But the LORD said unto Samuel, Look not on his countenance, or on the height of his stature; because I have refused him: for the LORD seeth not as man seeth; for man looketh on the outward appearance, but the LORD looketh on the heart.