An argument arose among the disciples about which of them was the greatest. Jesus realized the intention of their hearts and took a child and placed it by his side and said to them, “Whoever receives this child in my name receives me, and whoever receives me receives the one who sent me. For the one who is least among all of you is the one who is the greatest.” Then John said in reply, “Master, we saw someone casting out demons in your name and we tried to prevent him because he does not follow in our company.” Jesus said to him, “Do not prevent him, for whoever is not against you is for you.”
Because our Lord had said, "He who is least among you all, the same shall be great", John feared, that perhaps they had done wrong in hindering a certain man by their own power. For a prohibition shows the probitor to be one who thinks himself superior. Hence it is added, "And John answered and said, Master, we saw one casting out devils in your name, and we forbade him." Not indeed from envy, but to distinguish the working of miracles, for he had not received the power of working miracles with them, nor had the Lord sent him as He did them; nor did he follow Jesus in all things. Hence he adds, "because he follows not with us."
Now John is not blamed, because he did this from love, but he is taught to know the difference between the strong and the weak. And therefore our Lord though He rewards the stronger, yet does not exclude the weak; as it follows, "And Jesus said to him, Forbid him not, for he that is not against you is for you." True, O Lord. For both Joseph of Arimathea and Nicodemus, Your secret disciples due to fear, when the time came, did not refuse their offices. But still since you said elsewhere, "He that is not with me is against me, and he that gathers not with me scatters", explain to us lest the two seem contrary to one another. And it seems, if any one considers the Searcher of hearts, he cannot doubt that every man's action is distinguished by the motive of his heart.
Now why does He in this place say that they are not to be hindered, who by the imposition of hands can subdue the unclean spirits, when according to Matthew, He says to these, "I never knew you"? But we ought to perceive that there is no difference of opinion, but that the decision is this, that not only the official works but works of virtue are required in a priest, and that the name of Christ is so great, that it serves to give defense even to the unholy, but not grace. Let no one then claim to himself the grace of cleansing a man, because in him the power of the eternal Name has worked. For not by your merits, but by his own hatred, the devil is conquered.
Catena Aurea (St. Thomas Aquinas)
Commentary on the Gospel according to Saint Luke (St. Ambrose of Milan)
Explanations on the New Testament (St. Theophylact of Ochrid)