Why this warning?

If anyone comes to you and does not bring this doctrine, do not receive him into your house nor greet him; for he who greets him shares in his evil deeds.
2 John 1:10-11 

What does this mean, and what does this not mean?  Context is oh, so important.  John was writing to warn us about false teachers  in the Church.  He was warning us about those who purport to be teachers (not just confused individuals) in the Church (not false teachers or lost individuals outside the Church.)  And by in the Church, he does not mean just in our church.  He is speaking of those who claim to be a part of Christ’s Church.  We must not even receive such people into our homes—unless of course there is genuine repentance.

This is not referring to teachers who represent ideas that differ from ours regarding secondary doctrines about which true Christians may differ.

Why this warning?  So that (a) uninformed sheep not be led astray, and (b) we do not encourage or embolden false teachers or their false doctrines.  So unless we are looking into what we know is false doctrine for the purpose of understanding it so that we may refute it—we must not have fellowship with those who claim to be Christians who teach false doctrine.

That is how important purity in doctrine is!