Excerpts from "The Sermon on the Mount" in
The Cost of Discipleship
by Dietrich Bonhoeffer
For background information see
Verse 22: "Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven." Matthew 7:21
The separation which the call of Jesus creates goes deeper still. After the division between Church and world, between nominal Christians and real ones, the division now enters into the very heart of the confessional body. St Paul says: “No man can say, Jesus is Lord, but in the Holy Spirit” (I Cor.12.3). It is impossible to surrender our lives to Jesus ‘or call him Lord of our own free will. St Paul is deliberately reckoning with the possibility that men may call Jesus Lord without the Holy Spirit, that is, without having received the call. It was harder to understand this in days when it brought no earthly gain to be a Christian and when Christianity was a dangerous profession. “Not every one that saith unto me, Lord, Lord, shall enter the kingdom of heaven."...[p.214]
“Lord, Lord” is the Church’s confession of faith. But not everyone who makes this confession will enter the kingdom of heaven. The dividing line will run right through the confessing Church. Even if we make the confession of faith, it gives us no title to any special claim upon Jesus. We can never appeal to our confession or be saved simply on the ground that we have made it....[214-215]
God will not ask us in that day whether we were good Protestants, but whether we have done his will..... The Church is marked off from the world not by a special privilege, but by the gracious election and calling of God....
[Notice this clear separation between  those who merely claim to be Christians and  those who are "born again" and demonstrate His grace by their lives. This is not a "works-oriented" faith, but the evidence of genuine, humble life-changing faith in Jesus Christ as their Lord]
[Greek words]—the man who says “Lord, Lord”—means the man who puts forward a claim on the ground that he
has said “it.” [Greek words] —the doer—is the man of humble obedience. The first is the one who justifies himself through his confession, and the second, the doer, the obedient man who builds his life on the grace of God...
The  man who says “Lord, Lord” has either called himself to Jesus without the Holy Spirit, or else he has made out of the call of Jesus a personal privilege. But our  doer of the will of God is called and endued with grace, he obeys and follows. He understands his call not as his right, but as an act of God’s judgement and grace, as the will of God, which alone he must obey. The grace of Jesus is a demand upon the doer, and so his doing becomes the true humility, the right faith, and the right confession of the grace of the Cod who calls. [215-216]
Verse 22: "Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many wonderful works? 23 And then will I profess unto them, I never knew you: depart from me, ye that work iniquity." Matthew 7:22-23
....At this point Jesus reveals to his disciples the possibility of a demonic faith which produces wonderful works quite indistinguishable from the works of the true disciples, works of charity, miracles, perhaps even of personal sanctification, but which is nevertheless a denial of Jesus and of the life of discipleship. This is just what St Paul means in I Cor. 13, when he says that it is possible to preach, to prophesy, to have all knowledge, and even faith so as to remove mountains, and all this without love, that is to say, without Christ, without the Holy Spirit.
More than this, St Paul must even reckon with the possibility that the very works of Christian charity, giving away one’s goods, and even martyrdom, may be done without love, without Christ, without the Holy Spirit. Without love: that is to say, in all this activity the activity of discipleship is absent, namely that activity the doer of which is in the last resort none other than Jesus Christ himself.
Here is the most serious, most incredible satanic possibility in the Church, the final division, which only occurs at the last day. But Christ’s followers must ask by what ultimate criterion Jesus will accept or reject them. Who will pass ‘the test, and who will not? The answer lies in the words of Jesus to the last of the rejected: “I have never’ known you.”
Here we are at last, here is the secret we have been waiting for since the Sermon on the Mount began. Here is the crucial question—has Jesus known us or not? First came the division between Church and world, then the division within the Church, and then the final division on the last day. There is nothing left for us to cling to, not even our confession or our obedience. There is only his word: “I have known thee,” which is his eternal word and call.
The end of the Sermon on the Mount echoes the beginning. The word of the last judgement is foreshadowed in the
call to discipleship. But from begining to end it is always his word and his call, his alone. If we follow Christ, cling to his word, and let everything else, go, it. will see us through the day of judgement. His word is his grace. 
"Every one therefore which heareth these words of mine, and doeth them, shall be likened unto a wise man, which built his house upon the rock: and the rain descended, and the floods came, and the winds blew, and beat upon that house; and it fell not: for it was founded upon the rock.
"And every one that heareth these words of mine, and doeth them not, shall be likened unto a foolish man, which built his house upon the sand: and the rain descended, and the floods came, and the winds blew, and smote upon that house; and it fell: and great was the fall thereof.
"And it came to pass, when Jesus ended these words, the multitudes were astonished at his teaching: for he taught them as one having authority, and not as their scribes." (Matt. 7.24-29)
We have listened to the Sermon on the Mount and perhaps have understood it. But who has heard it aright? Jesus gives the answer at the end. He does not allow his hearers to go away make of his sayings what they will, picking and choosing from them whatever they find helpful, and testing them to see if they work. He does not give them free rein to misuse his word with their mercenary bands, but gives it to them on condition that it retains exclusive power over them.
Humanly speaking, we could understand and interpret the Sermon on the Mount in a thousand
different ways. Jesus knows only simple surrender and obedience, not applying it, but doing and obeying it. That is the only way to hear his word....
The only proper response to this word which Jesus brings with him from eternity is simply to do it. Jesus has spoken: his is the word, ours the obedience. Only in the doing of it does the word of Jesus retain its honour, might and power among us. Now the storm can rage overthe house, but it cannot shatter that union with him, which his word has created.
There is only one other possibility, that of failing to do it.... If we start asking questions, posing problems, and offering interpretations, we are not doing his word. Once again the shades of the rich young man and the lawyer of Luke 10 are raising their heads. However vehemently we assert our faith, and our fundamental recognition of his word, Jesus still calls it “not-doing.”
But the word which we fail to do is no rock to build a house on. There can then be no union with Jesus. He has never known us. That is why as soon as the hurricane begins we lose the word, and find that we have never really believed it. The word we had was not Christ’s, but a word we bad wrested from him and made our own by reflecting on it instead of doing it. So our house crashes in ruins, because it is not founded on the word of Jesus Christ.
“The multitudes were astonished....“ What had happened? The Son of God had spoken. He had taken the judgement of the world into his own hands. And his disciples were standing at his side. [219-220]
Books and quotes by Dietrich Bonhoeffers:
The Cost of Discipleship | Life Together
Meditations on the Cross