"The kingdom of heaven is not come even when God's will is our law; it is fully come when God's will is our will." George MacDonald
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!’
To know right from wrong, to acknowledge God's law of the Ten Commandments is not enough. Your righteousness must surpass that of the Scribes and Pharisees. They trusted in their own righteousness to obtain salvation. Their works were done in the flesh for self-glory and self-exaltation.
"For I have come down from heaven, not to do my own will but the will of him who sent me. And this is the will of him who sent me, that I should lose nothing of all that he has given me, but raise it up on the last day. For this is the will of my Father, that everyone who looks on the Son and believes in him should have eternal life, and I will raise him up on the last day.”
God's will is for us to live a life to trust fully in Him and not in ourselves. Our will becomes God's will when we have faith in His Son. We have to know Christ in an intimate relationship as our Savior and Lord. If you love Him....keep His commandments.