2 John 9-11 can only be understood within the social setting of early Christianity. It presumes the practice of itinerant radicalism, in which charismatic teachers and healers wandered from town to town, from church to church, where they received lodging in exchange for their services. They lived in poverty without any possessions or money of their own. This is the kind of homeless vagabond lifestyle promoted or referred to in Matthew 6:25-34, 8:19-22, 10:5-42, 23:34, Mark 10:17-31, Luke 10:5-15, 12:22-34, etc. as a particularly higher calling to discipleship. Itinerant preachers and healers thus had a significant degree of prestige and authority in the Christian community (cf. the "Seventy" that were sent out as apostles in Luke 10; the church historian Eusebius claimed that these included Barnabas, Cephas, Thaddeus, Matthias, and Joseph Barsabbas Justus). Paul also lived an itinerant lifestyle for much of his ministry. Early Christian society was split between resident communities where Christians owned property and were subject to the rules of the community (cf. Matthew 18), whereas the wandering itinerants were dependent on these host communities for their hospitality. The Gospel of Thomas represents the itinerant ethos by portraying discipleship as involving homeless wandering, healing the sick, and accepting the hospitality that is provided, with the stated ideal: "Be passersby" (Thomas 14:2, 42:1, 86:1). It should not be forgotten that itinerants were not members of a given church but were usually external to it. They would stay a while for fellowship before moving on.
There however was room for much conflict. Itinerant preachers did not share the same theological and eschatological perspective, and sometimes members in a given church would follow the teaching of different teachers. They also may view themselves as followers of a particular teacher or prophet. That was what happened in Corinth, with some members of the church following Paul and others preferring to follow Apollos (1 Corinthians 1-3), as well as what happened in the churches of Galatia when Paul began to lose his influence there to Torah-observant Jewish Christians (1:6-9, 4:17, 5:7-12, 6:12). The wandering poor were also sometimes discriminated against within the resident churches on account of their abject poverty. This was the perspective of the author of James. He mentions that some individuals were "chosen" (i.e. were a minority within Christian society) to be "poor in the eyes of the world" and "rich in faith" (2:5), i.e. poverty as a calling. But in some places, they were discriminated on account of their clothing and personal appearance while wealthy resident Christians were treated with higher respect (2:1-4). The Pauline focus on faith over works also devalued the importance of the itinerant lifestyle which aimed to achieve righteousness through "works", i.e. by living righteously through poverty. James 2:14-26 thus defended the value of works and encouraged resident Christians to perform their own good "works" by receiving itinerants with hospitality, using the example of Rahab who "received the messengers and then sent them out another way" (2:25). He thus condemned those who would send the itinerants away without caring for their needs: "If a brother or sister is without clothes and daily food and one of you says to him, 'Go on, I wish you well, keep warm and well fed,' but does nothing about his physical needs, what good is it?" (2:15-17). The author of James goes on to polemicize against commercial itinerism (4:13-15), wandering from town to town in order to make money. Similarly, the Didache (from the early second century AD) lays out clear guidelines on how itinerants were to be treated and advised resident Christians to reject them on account of their teaching or if they intend to profit in some way from their lifestyle:
"So, if anyone should come and teach to you all these things that have just been mentioned above, welcome him. But if the teacher himself goes astray and teaches a different teaching that undermines all this, do not listen to him. However, if his teaching contributes to righteousness and knowledge of the Lord, welcome him as you would the Lord. Now concerning apostles and prophets, deal with them as follows in accordance with the rule of the gospel. Let every apostle who comes to you be welcomed as if he were the Lord. But he is not to stay for more than one day, unless there is need, in which case he may stay another. But if he stays three days, he is a false prophet. And when the apostle leaves, he is to take nothing except bread until he finds his next night's lodging. But if he asks for money, he is a false prophet. Also, do not test or evaluate any prophet who speaks in the spirit (compare 1 John 4:1), for every sin will be forgiven but this sin will not be forgiven. However, not everyone who speaks in the spirit is a prophet, but only if he exhibits the Lord's ways. By his conduct, therefore, will the false prophet and the prophet be recognized. Furtherfore, any prophet who orders a meal in the spirit shall not partake of it, if he does, he is a false prophet...If anyone should say in the spirit, 'Give me money,' or anything else, do not listen to him. But if he tells you give on behalf of others who are in need, let no one judge him. Everyone who comes in the name of the Lord is to be welcomed. But then examine them, and you will find out if you have insight what is true and what is false. If the one who comes is merely passing through, assist him as much as you can. But he must not stay with you for more than two or, if necessary, three days. However, if he wishes to settle among you and is a craftsman, let him work for his living. But if he is not a craftsman, decide according to your own judgment how he shall live among you as a Christian, yet without being idle" (Didache 11:1-12:4).
This is the most detailed description of the itinerant lifestyle in early Christian literature and it casts much light on the situation in 2 John. Important here is the code of hospitality, such that even if itinerants have no real authority they have the right to be treated hospitably unless the visitor violates the stated guidelines, such as by asking for money (compare Matthew 10:9), staying too long, eating while in the spirit, etc., any of which proves that the visitor is a "false prophet" and to be shunned. Interestingly, these aspects of personal conduct seem to matter more than doctrine. The conflict between itinerant missionaries and resident Christians also plays out in 2 and 3 John, where the practice of shunning is mentioned in both letters as a reponse to itinerant visitors. In the first letter, Presbyter John (a leader from the early sub-apostolic period with significant personal prestige, as Papias and Polycarp relate) instructs the churches under his influence to refuse hospitality to itinerant teachers who teach what he regards to be false doctrine:
"Many deceivers, who do not acknowledge Jesus Christ as coming in the flesh, have gone out into the world. Any such person is the deceiver and the antichrist. Watch out that you do not lose what you have worked for, but that you may be rewarded fully. Anyone who runs ahead and does not continue in the teaching of Christ does not have God; whoever continues in the teaching has both the Father and the Son. If anyone comes to you and does not bring this teaching, do not take him into your house or welcome him. Anyone who welcomes him shares in his wicked work" (2 John 7-11).
It is important to recognize that these "deceivers" are not resident members of the church but outsiders who would be "coming to you" (erkhetai pros humas) from abroad who seek to be "received into your house" (lambanete eis oikian), i.e. itinerants like those in Matthew 10:12 who seek to be received "into homes" (eis tén oikian) and receive support. This has nothing to do with shunning members of the church itself; it has to do with taking in outsiders who are already known to be teachers of different doctrines, for this would require the church to give lodging, food, and support to the person -- thereby "sharing in his wicked work". In other words, the author here regards "deceivers" as illegitimate itinerants not worthy of the support that wandering teachers and missionaries would receive.
The ironic thing however is that Presbyter John himself was on the receiving end of this policy. Writing to Gaius, he thanked him for showing hospitality to the itinerant teachers who recently arrived (erkhomenón) to his own church (Ephesus?) who "testified to the truth of your life" (3 John 3), telling him: "You are acting loyally whenever you work for the brothers and especially for strangers (xenous). They have testified of your love before the church and you would do well to send them on their way (propemsas) in a manner that God would approve" (v. 6). The strangers should be sent on "worthily" (axiós), i.e. with the support that they deserve. This echoes the sentiment in James 2:15-17 which criticizes those who would send itinerants on without caring for their needs. "We are obligated to support such men (hémeis opheilomen hupolambanein tous toioutous), so that we may prove ourselves to be fellow-workers in the cause of truth" (3 John 8). This attitude contrasts sharply with the one in 2 John 7-11 which refuses even the simplest courtesy to itinerants regarded to be "deceivers". The author likely regarded such ones as wholly separate from the itinerants who deserve support. But he was shocked to learn that his own "brothers" (adelphoi) who were visiting different churches were being shunned!
"I have written something to the church but Diotrephes, who seems to enjoy being in charge of it, refuses to accept us. So when I come, I will bring up what he is doing, making unjustified charges against us with a malicious tongue. And not content with that, he himself refuses to receive the brothers (oute epidekhetai tous adelphous); he also tries to hinder (kóluei) those who want to welcome them, and he expels (ekballei) them from the church" (3 John 9-10).
Here John aligns himself with the rejected visitors by using the first person plural pronoun and in fact he had instructed them to deliver an epistle on his behalf. But the leader of the church refuses them. He treats them exactly the same way John wants to treat those he regards as heretics. It is not clear why Diotrephes refused the itinerant teachers representing John, but the reference to the "malicious charges" (logois ponérois) that Diotrephes brought against them raises the possibility that he regarded them -- and John in turn -- as "false teachers". So this practice of refusing itinerants was a double-edged sword. John also hints here that despite Diotrephes' authority inside the church, he would be able to settle the conflict if he goes there in person -- indicating that he retained much personal authority in the church. Some scholars believe that the conflict here had to do with authority, with John representing the older system of presbyters and Diotrephes being a relatively young bishop who did not recognize John's authority.