"Not everyone who says to Me, 'Lord, Lord' shall enter the kingdom of heaven, but he who does the will of My Father in heaven." [Matt 7:21]
In my previous post, I commented on how the fact that not all will be saved seems to be a recurring theme in the teaching's of Christ. In Matt 7:21-23 He elaborates more on that idea.
According to Jesus, there will be some on the day of Judgement who believe they know Christ and are expecting to be saved. They will see their Lord standing before the seat of judgement and run to him as the prodigal son returning home, but instead of being greeted with open arms as they expect, the Lord will answer "I never knew you; depart from Me, you who practice lawlessness!" Why? Didn't they prophesy, cast out demons, and do many wonders, all in the name of Christ? What more does He want?!
Christ will later reference Hosea 6:6: "I desire mercy and not sacrifice, and the knowledge of God more than burnt offerings." His point was that even though the Old Law required animal sacrifices and burnt offerings, one could not simply buy his way into heaven with those things. One cannot simply follow the motions and be saved.
So how then does one enter heaven? Christ tells us in the same passage: "...but he who does the will of My Father in heaven." Doing the will of God means more than just going through the motions. It's more than just attending prayer meetings and knocking on doors. As James puts it [James 2:14-26], we must have both faith and works, not just one or the other. If our works are done with a lack of faith, they profit us nothing. If our faith is lacking works, it profits us nothing.
As in all things, let Christ be our example. Imitate Christ, both His love for God and His love for others, and you will understand the will of the Father.