Matthew 5:20. For I tell you, unless your righteousness exceeds that of the scribes and Pharisees, you will never enter the kingdom of heaven.
Here you see Him taking hold. He does not speak in generalities against plain people, but against the best people in the whole nation, the elite and the paragons of virtue, who shone like the sun in comparison with the others. In the whole nation no class was so highly praised and no titles so highly honored as that of the Pharisees and scribes. If you wanted to call a man holy, you would have to call him a Pharisee, just as among us the Carthusians or hermits have this reputation. Undoubtedly the disciples of Christ themselves supposed that there was no greater holiness to be found than the holiness of these men, and nothing was farther from their mind than that He would attack these people. He did not venture to call them by name right away. Instead of accusing certain individuals among them, He accused the entire class, condemning not particular vices or sins but all their righteousness and holy living. He goes so far as to exclude and reject them from the kingdom of heaven, to sentence26 them straight to hell-fire. It is as if He were to say of our time: “The priests and monks and those who are called ‘spiritual,’ all of them without exception, are damned to hell eternally, with all their works and ways, even when these are at their best.” Who could hear or bear such a sermon?
Note first that while He concedes that they have a righteousness and that they lead an upstanding and honorable life, He so utterly rejects it that if it does not improve, it is already condemned and everything it can accomplish is lost. Note, secondly, that He is talking about people who would like to get to heaven and who take the other life seriously. This the great rude mass does not care about; they do not ask about God or the Word of God, and what we say about the Gospel is preached for nothing to them. But it is preached to the others, to teach them that such righteousness is a false righteousness that must be salted and corrected, a deception both to themselves and to others, and a road that leads away to hell. It is also intended to illumine for them the real piety which the Law demands, as Christ will now show.
Luther, M. (1999, c1956). Vol. 21: Luther's works, vol. 21 : The Sermon on the Mount and the Magnificat (J. J. Pelikan, H. C. Oswald & H. T. Lehmann, Ed.). Luther's Works (21:73). Saint Louis: Concordia Publishing House.