Find out more about the Scribes and Pharisees
Much of these words of reproof found in Matthew's Gospel seem to be aimed at the scribes and Pharisees, two groups who were particularly rigid in their interpretation of the law and often condemned everyone else while justifying their own behaviour.
In the 1st century AD, scribes and Pharisees were two largely distinct groups. Scribes had knowledge of the law and could draft legal documents (contracts for marriage, divorce, loans, inheritance, mortgages, the sale of land, and the like). Every village had at least one scribe. Pharisees were members of a party that believed in resurrection and in following legal traditions that were ascribed not to the Bible, but to “the traditions of the fathers.” Like the scribes, they were also well-known legal experts: hence the partial overlap of membership of the two groups. It appears from subsequent rabbinic traditions, however, that most Pharisees were small landowners and traders, not professional scribes. (Encyclopedia Britannica)
You might like to look at Jesus' words to the Scribes and Pharisees in Matthew, Chapter 23.