Treasures in Heaven
Matthew 6 plays out another aspect of the key verses
of the Sermon on the Mount: “Unless your righteousness surpasses that of the Pharisees and the teachers of the law, you will certainly not enter the kingdom of heaven” (5:20). If someone hearing this verse actually knew some Pharisees, the verse would have been terrifying. Really? More righteous than a Pharisee? No hope for me!
Pharisees were known for how carefully they kept the Jewish Law. They were so serious about keeping the Jewish Law that they had developed extremely specific rules that spelled out very concretely what it might mean to keep the Sabbath holy or not to covet. While it's easy for us to condemn them or dismiss them as hypocrites, we can develop our own traditions about how to keep the rules too.
For example, when I was a young boy, I once visited a church on a Sunday evening that was very strict on keeping Sunday as a Sabbath. Taking Exodus 20:6 very seriously, they did not believe in working on Sunday. In the hour before the evening service, I visited a nearby playground and was swinging. An older person came up to me and told me I needed to leave the playground because it was the Sabbath. Her thought was that, for a kid, playing was my work. I should stop swinging--that is working--because it was the Sabbath.
It is really ironic to me now to realize how similar this person was being to some of the ancient Pharisees. Being so zealous to keep the Law, they played out the rules into every area of life. The problem is not so much their eagerness to keep God's Law but the fact that for some of them the rules became an end in themselves. Some of them apparently lost sight of what was much more important to God--loving people. 
So to say that you had to be more righteous than the Pharisees would have been terrifying to an average Jew. Although today we assume they obviously fakers or evil, Pharisees enjoyed great popularity among most Jews. We have to make ourselves feel the shock of this statement.
When we get to Matthew 6, we begin to understand what Jesus is saying. The righteousness of Israel's teachers of the Law is a this-worldly righteousness. It is a righteousness for show. The stereotypical Pharisee Matthew has in mind is an actor, a hypocrite who is playing at acts of righteousness but does not have truly heavenly values...
 We should remember that the Gospel of Matthew is probably harder on the Pharisees in its presentation because the community that produced Matthew was probably in serious tension with the Pharisees. Most experts think that Matthew was written after the Jerusalem temple was destroyed, when the Pharisees were perhaps the only major Jewish group left. With them in power, they became the leaders of Judaism and thus the perhaps main Jewish opposition to Christian Jews.