II John is a letter to a Christian friend, warning her that there are false teachers who may ask for food and shelter. He advises her to beware and not invest her time, effort and money in them.
Many of the false teachers causing problems were proto-Gnostics (fore-runners of a movement that developed later, called Gnosticism).
Proto-Gnosticism (and later, Gnosticism) differed from Christianity in a number of ways. The beliefs were; only spirit is good; everything else in the world (including our human form) is evil, secretive, selective knowledge of Christ leads to salvation, Jesus wasn't actually human all the time during his time on earth. Somehow, these beliefs lead some to the belief that breaking God's laws and immorality would have no consequences.
John warns Christians to stay away from such teachings.