With repeated mention and magnified emphasis on hospitality came warning. You couldn't accept just anyone into your home. False teachers would come along too and required necessary screening. Truth was the boundary of acceptance. This was the pattern set by Jesus and then followed by John the Apostle himself in his second epistle.
We love one another. Hospitality was necessary, but it wasn't love if it wasn't compatible with the truth. Love itself by definition is walking according to the Lord's commandments. John rejoiced that the children of the lady addressed in 2 John were walking in the truth. Hospitality is important, but not at the expense of truth. Truth is the boundary of acceptance.
Men arrived impersonating true evangelists, looking for a place to stay and then preach. They were not to be accommodated. At that time, deceivers were getting around and saying that Jesus Christ was not come in the flesh. This would be a typical false doctrine at that time in the Roman world. We can read about something similar that damaged the Corinthians into a denial of bodily resurrection (cf. 1 Cor 15).
Hospitality was a first century form of missions support. Evangelists weren't getting bank checks, but they were taking lodging and food from church people. Hospitality was good, but it was horrendous if it was subsidizing damning doctrine. Truth prevails over love. Love without truth isn't love. Hospitality without truth causes harm.
John moves to a specific example from a general principle. No error, no lie should be accepted. Love isn't walking in selected commandments. Characteristic of a true preacher is that he preaches the truth. Truth is a larger category than fundamentals or just the gospel. John loved in the truth, not in some truths or essential truths. If you want to preserve the truth, you can't let any truth go by the wayside. You shouldn't allow any lie to be taught and preachers of any lies should not be given opportunities to tell their lies.