For I tell you, unless your righteousness exceeds that of the scribes and pharisees, you will never enter the kingdom of heaven.
This would have been a shocking statement for everyone listening to Jesus. We are used to thinking of the Pharisees as the bad guys but, at the time, there appeared to be no group of people more committed to following and serving God. The Pharisees devoted their entire lives to God's law and went to whatever lengths necessary to avoid breaking it, making laws around the laws to avoid going anywhere near sin.
So if Jesus is saying it is necessary to be more righteous than that, then who stands a chance? Exactly. I have not tried as hard as the Pharisees to be righteous and neither have you. But they were not righteous enough. The greater righteousness that Jesus talks about is not about going further than them - following 700 laws instead of 600 hundred - but about going deeper. The righteousness that the Pharisees were concerned with was about modifying behaviour but Jesus looks beyond that into the heart. As he will go on to explain, Jesus says that it is possible to obey a command externally but break it internally. If you thought your actions were ok, there's a deeper level were you fail to be righteous. If you already thought your actions were bad enough, it's worse than you thought!
That is why it's such great news that God made him who knew no sin [Jesus] to become sin, so that , in him, we might become the righteousness of God (2 Corinthians 5:21)