The Great Sermon
The Great Sermon serves as a covenant renewal document. What we have in chapters 5-7 is a compilation of Jesus' teachings by Matthew in the form of the gospel, or more particularly, a covenant renewal document. In fact, it is likely that Jesus did actually enact a covenant renewal ceremony beginning with the beatitudes. As a covenant renewal document it reflects the format of Deuteronomy, alluding to the delivery of the Mosaic covenant on Mount Sinai (anebh eiV to oroV, "he went up to the mountain"); It is delivered to the new Israel, to the disciples, rather than touV oclouV, "the crowds."
In the New Testament the gospel (euaggelion, "important news") encapsulates the restatement of the covenant, "I am your God, you are my people" - an announcement of divine grace appropriated through faith. At first sight the Sermon on the Mount bears little resemblance to a proclamation of the gospel, but it is Matthew's selection and arrangement of Jesus' teachings in chapters 5-7 which serves to reveal the gospel. By his arrangement of Jesus' teachings Matthew reveals the mystery / gospel of grace, namely, that a person's right-standing in the sight of God, and thus their full appropriation of the promised covenant blessings, is gifted by divine grace through faith, and not by works of the law.
Jesus begins the Great Sermon in like manner to the ten commandments, "I am the Lord your God, who brought you out of Egypt, out of the land of slavery (a people saved by grace) therefore ......" / "Blessed are you the poor in spirit for yours is the kingdom of heaven ...... therefore ....." The "therefore" of the covenant agreement between God and his people, although serving as a guide, primarily drives the child of God to rely, not on works for covenant blessings, but on the faith exhibited by Abraham when the covenant was first established.
Matthew shapes this same formula in his selection of gospel tradition in the Great Sermon. He begins by establishing the ground upon which God's people stand, a people saved by grace, a people possessing the kingdom, comforted, inheriting the earth, filled, having received mercy, set to see God face-to-face, children of God. Yet, in being a child of God, the "therefore", the promised blessings are quickly overshadowed by the cursings. We may not murder, but we do hate; we may not be an adulterer, but we do lust. So it is that by the end of the Great Sermon we recognize that we have built our house on sand and so face catastrophe.
Matthew reveals something of the answer to this problem in chapter 6, but in the following narrative section, 8:1-9:34, he leads us to the faith of Abraham. It is hear that we learn that we are saved / healed by grace through faith. Matthew's message is simple: the promised blessings of the covenant are ours as a gift of grace through faith in Christ, and not by works of the Law lest anyone should boast.
To consider further the Sermon on the Mount as a covenant renewal document see Dumbrell in The Logic of the Role of the Law in Matthew, Novum Testamentum, 23/1, 1981.
The Law: With regard Jesus' exposition of the law of the kingdom, with particular reference to Matthew chapter 5, If it is true that our righteousness must exceed that of the Pharisees and the Teachers of the law for us to enter the kingdom of heaven, 5:20, then obviously few will enter. If only those who do the will of the Father enter the kingdom of heaven, 7:21, then actually none of us will enter (none, of course, save the one righteous man, Jesus). There are none who hear the words of Jesus and put them into practice, 7:24. So then, what is the function of Jesus' idealistic restatement of the Torah?
The apostle tells us that our eternal right-standing in the sight of God is maintained and progressed apart from works of the law, ie., apart from law-obedience. The law that Paul is primarily addressing is the Mosaic law, but in the end it includes all divine law. The prime function of this law is to expose sin, and so by undermining nomistic self-righteousness, force us to rest on God's gracious mercy in Christ, Gal.3:24. So, covenant standing is maintained through the instrument of faith, the same faith in the mercy of God that accounted Abraham righteous in the sight of God. Only as a secondary function does the law serve to guide the practical outworking of faith, guiding the renewing work of the Holy Spirit. Paul's radical theology is not of his own making since it came from Jesus. One obvious source is Jesus' teachings in the Sermon on the Mount. In the sermon we have a detailed exposition of the law which removes any possibility of anyone ever claiming to have done it. Few people will ever commit murder, but we all get "angry with a brother", sooner or later, and so we all face the fires of hell.
It is worth noting that the Sinai covenant served the same end. Law but reinforced dependence / faith in divine grace - "I am the Lord your God who brought you out of the land of Egypt, out of the land of slavery"; "I will walk among you and will be your God, and you shall be my people." Blessing, or cursing, rests on the ground of faith, a faith like Abraham's. Law but reminds us of this fact, while guiding the life of faith.
So, in the Sermon on the Mount, particularly chapter 5, Jesus' exposition of the moral law serves to expose our state of sin, so undermining any self-righteous notion that by law-obedience we can restrain sin for the appropriation of the promised blessings of the covenant. We are being told, in no uncertain terms, that we have built our house on the sand and therefore face the destruction of coming judgment. Only through faith in the faithfulness of Christ (the cross) will we realize the promised blessings detailed in v3-10. It is by grace through faith and not works of the law that we appropriate the blessings of the covenant.