Re: He Denied Them Twice. Did those in Matt. 7:22-23 believe they were doing God’s will? Did they believe the Lord sanctioned their actions? It would seem they did if they approached Christ expecting Him to recognize them. Did God, then, allow them to deceive themselves and believe they were saved when they really were not?
From the text it appears they believed they were acting in His name and expected to be welcomed into the Kingdom. 2 Peter 3:9 says God doesn’t want anyone to perish, so we can’t assume that He “allowed” this. Because His word makes the requirement for salvation clear, the blame for the predicament they’re in rests with them. (I sometimes wonder just how many “Christians” fall into this category and will find themselves on the outside looking in because they accepted someone’s opinion on what it takes to be saved instead of confirming it for themselves.)
In 2 Thes. 2:9 Paul wrote that the Lord will allow those who have refused to believe the truth to be deceived, but I think this only applies to those who have already rejected Him. If so it makes theirs a different case.