Ezra was a scribe during the Babylonian captivity of the Jews, and he was a very godly man. The office of a scribe was a worthy one, but the scribes of Jesus' day were often rebuked by Him for having gone beyond the job of copying out the scriptures. They had a large amount of interpretations that they had added to the scriptures based on traditions, and had made "the word of God of none effect" (Mark 7:13).
The scribes became an independent company of interpreters of the law and leaders of the people. Even they, themselves, sought to avoid certain of their own precepts (Matthew 23:2-4). They clashed with Jesus for He taught with authority and condemned the external formalism that they promoted (Matthew 7:28-29). They persecuted Peter and John (Acts 4:3-7) and had a part in Stephen's martyrdom (Acts 6:12). Although the majority of them opposed Jesus, some did believe (Matthew 21:15).
Jesus exposed the hypocrisy of the scribes by dealing with issues of the heart. They appeared to be holy outwardly, but their hearts were far from God.