I realized that I thought it would be fun to "arc" through the verses myself as I'm trying to memorize them. If you want an introduction to arcing - see www.biblearc.com. Unfortunately, there's no easy way to "embed" the arc, so I'm going to link to my arc, and copy-paste the notes that I wrote here.
If you don't know how to arc, you can just read around the arc terminology. We'll see how long this lasts.
Summary: This passage is a warning for those who seek to relax the commandments of God (v.19ab). Rather than relaxing them, we ought to do them and teach them (v.19cd). Because, in order to enter the kingdom, we must have our righteousness exceed that of the scribes and Pharisees (v.20)
Passage analysis: Because not a single iota or dot will pass from the law (v.17-18), Jesus gives two If-Then statements as alternate possibilities to spur us on to proper obedience.
1) If someone weakens even the least of the command then, just like such a person might call those commands "least," that person will be called least in the kingdom of heaven.
2) If someone does the word and teaches the same, then that person will be called great in the kingdom of heaven.
And then he gives the ground for these statements (v.20):
"For unless your righteousness exceeds the Scribes and Pharisees, you will never enter the kingdom of heaven."
This passage isn't talking about the imputed righteousness of Christ. It's talking about our external righteousness - our actions. Are we living as salt and light in this world? (v.13-16) Are we commiting adultery or murdering our brothers in our thoughts? (v.21-30)? These are all areas where the scribes and Pharisees were relaxing the laws of God. But we are called to a higher calling - to one of faithful obedience, to doing and teaching the laws of God.
What of faith? I think faith must be what undergirds all of this obedience. The beatitudes of Matthew 5:3-12 point us to the fact that God has made great promises- Gospel promises that enable us to persevere, endure, and obey. In support of that, we notice that the obedience to the law of God (v.17 and following) follows the promises of God (v.3-12) rather than precedes.