21 “Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but only the one who does the will of my Father who is in heaven. 22 Many will say to me on that day, ‘Lord, Lord, did we not prophesy in your name and in your name drive out demons and in your name perform many miracles?’ 23 Then I will tell them plainly, ‘I never knew you. Away from me, you evildoers!’ Matthew 7:21-23
Let’s be clear. Biblical salvation is through faith in Christ alone.
For it is by grace you have been saved through faith, and this not from yourselves; it is the gift of God, not by works, so that no one can boast. For we are His workmanship, created in Christ Jesus for good works, which God prepared beforehand so that we would walk in them. Ephesians 2:8-10
We can’t earn salvation nor can we work our way into it.
So what are these verses referring to?
In context with the previous passages, I believe Jesus is elaborating on the false teachings of the false preachers and prophets. Only Christ knows what’s in their hearts at the end of the day. While it may look flashy exercising demons or preaching in Jesus’ name, that really isn’t what matters.
The only people who will enter heaven are those who do the Father’s will. So even though the false teachers look like they should be in heaven based on what they’re doing, only what’s in the heart is all that matters.
Did they have faith in Christ?
Did they trust in Him alone for salvation?