The following is an excerpt from
The MacArthur New Testament Commentary on 2 John 1:10.
In verse 10 John sets out one practical application of how to defend the truth: If anyone comes to you and does not bring this teaching, do not receive him into your house. Hospitality for traveling teachers was common in the culture (cf. Luke 9:1-6; 10:1-12). The prohibition here is not to turn away the ignorant; it does not mean that believers may not invite unbelievers—even those who belong to a cult or false religion—into their midst. That would make giving the truth to them difficult, if not impossible. The point is that believers are not to welcome and provide care for traveling false teachers, who seek to stay in their homes, thereby giving the appearance of affirming what they teach and lending them credibility
John’s use of the conjunction ei (if) with an indicative verb indicates a condition that is likely true. Apparently, the lady to whom he wrote had for whatever reason, in the name of Christian fellowship, already welcomed false teachers into her home. It was just such compassionate, well-meaning people that the false teachers sought out (cf. 2 Tim. 3:6); since churches were supposed to be protected by elders who were skilled teachers of the Word (1 Tim. 3:2; Titus 1:9), they should have been less susceptible to the lies propagated by the deceivers. Having established themselves in homes, the false teachers hoped eventually to worm their way into the churches. It is much the same today, as false teaching insidiously invades Christian homes through television, radio, the Internet, and literature.
So threatening are these emissaries of Satan that Jon went on to forbid even giving them a greeting; for the one who gives him a greeting participates in his evil deeds. Irenaeus relates that the church father Polycarp, when asked by the notorious heretic Marcion, “Do you know me?” replied, “I do know you—the firstborn of Satan” (Against Heresies, 3.3.4). John himself once encountered Cerinthus (another notorious heretic) in a public bathhouse in Ephesus. Instead of greeting him, however, John turned and fled, exclaiming to those with him, “Let us fly, lest even the bath-house fall down, because Cerinthus, the enemy of the truth, is within” (Irenaeus, Against Heresies, 3.3.4).