Righteousness means having a right love for God leading to a right relationship with him and others, producing right actions. The Pharisees were exacting and scrupulous in their attempts to follow their laws. They thought that was what they needed to do to please God. So how could Jesus reasonably call us to greater righteousness than theirs?
The Pharisees weakness was that they were content to obey the laws outwardly without allowing God to change their hearts or attitudes. They looked good and acted piously, but they were far from the kingdom of heaven.
God is concerned about our hearts as well as our deeds, because our hearts shows where our true allegiance lies.
Jesus was saying that his listeners needed a different kind of righteousness altogether out of love for God, not just a more intense version of the Pharisees’ obedience.
Our righteousness must come from what God does in us, not what we can do for ourselves. It must be God centered. It must be based on a reference for God. And it must go beyond keeping the law to living by the principles behind the law. We should be just as concerned about our attitudes that people don’t see, as about our actions that are seen by all.