False Disciples
You know what people are really like, by seeing what they do over a long period of time. The 'fruit' of their lives is the natural expression of what is in their hearts. That is how to identify false prophets (Matthew 7:15-20). Jesus had been referring to the religious leaders of His day who claimed to speak for God but were opposed to His will. As Jesus preached and did many miracles, a large crowd of people followed Him. They claimed to be His disciples but many were not.
Jesus knew what was in their hearts. They really wanted to be fed (John 6:26-29) or to be delivered from Roman occupation (John 6:15), or to exercise spiritual power (Acts 8:18-23). They were false disciples; and when Jesus told them that His earthly destiny was betrayal, suffering and death - they stopped following Him (John 6:66-69). Their dream of sharing Christ's glory did not include taking up their cross (Matthew 10:38); and so they left him.
Not everyone who claims to be a disciple is a true disciple. Even people who build their reputation through powerful speaking and miracles are false disciples if they are not doing the Father's will. Indeed Jesus predicted that on Judgement Day many religious people would present their power-packed lives before Him: but they would be rejected from heaven because they had failed to do what Father God had commanded them. They were hypocrites who had done their own will, sought their own glory and received their own reward of human applause (Matthew 6:1,5,16). God's will had been ignored and His reward forfeited.
It seems strange that Jesus should describe some preaching, exorcism and miracles as "evil-doing"; especially if it is in Jesus' Name. But if it is not God's will, it is evil. This would be have been sobering for the twelve disciples and Peter would have remembered it when Jesus called him, 'Satan', when he tried to obstruct God's will (Matthew 16:23). If those who Christ appointed as apostles needed to hear this challenge to surrender every motive and action to God's will; so do we. All who work for Christ need to make sure that they are doing the Father's will and not their own, whatever the context ... home or work or church. "Let us examine our ways and test them, and let us return to the Lord." (Lamentations 3:40)