1 Corinthians 5:9-11 (NKJV), 9 "I wrote to you in my epistle not to keep company with sexually immoral people. 10 Yet I certainly did not mean with the sexually immoral people of this world, or with the covetous, or extortioners, or idolaters, since then you would need to go out of the world. 11 But now I have written to you not to keep company with anyone named a brother, who is sexually immoral, or covetous, or an idolater, or a reviler, or a drunkard, or an extortioner–not even to eat with such a person."
These verses teach that consecrated Christians are not only to avoid friends in the world [James 4:4 (NKJV) "…Do you not know that friendship (phileo) with the world is enmity with God? Whoever therefore wants to be a friend of the world makes himself an enemy of God.”], but also professed Christians who are behaving in unholy manners.
Yes, we agape (love) them, but we do not phileo (friendship love) them. We are always kind, respectful, helpful, but we do not develop relationships with them. If an immoral person seeks us out – looking to change his ways or to learn about God – then we wisely and gently preach the truth. However, we do not seek out these relationships.
Those we befriend will influence our thinking and behaviors in subtle ways. That's always the way temptations and evilness creep into our lives. The fallen flesh argues, “a little compromise here or there is not so important nor serious." But it is serious. Song of Solomon 2:15 (NKJV), "Catch us the foxes, The little foxes that spoil the vines, For our vines have tender grapes." These are the cute little sins that spoil our character fruitage.
We may say,–"What's the point of such carefulness and of living a life so different from the world?” There is great use in it, for victories in little things prepare for greater things and make them possible: and on the contrary, surrender to the will of the flesh in the little things means sure defeat in the warfare as a whole.
As Jesus said, “Whoever desires to come after Me, let him deny himself, and take up his cross, and follow Me.” Mark 8:34 (NKJV)