James 4:4 ... know ye not that the friendship of the world is enmity with God? whosoever therefore will be a friend of the world is the enemy of God.
Do we "love" those in our life and continue to hang out with them after that we have received the knowledge of the Truth? (2 Peter 2:20-22) How do we become separate (2 Cor 6:17) if we don't change our life and begin doing the things of God instead of continuing in the same life we had?
To love them is to warn them of their wicked ways and try to save their soul.
To love them and excuse their wicked behavior is to hate their soul as you are condemning them to hell by not telling them the truth. Ezek 33:6-9
We should not leave the world but we should never take part with the works of darkness (any sinful thing) and we should preach the truth to everyone. Those that will not listen we should leave behind lest we allow them to drag us back into the mire. (Eph 5:11, Mark 4:18-19)
We should warn everyone claiming to know Jesus that does not obey Him and rebuke them soundly. (Rom 15:14, Titus 3:10-11, Proverbs 27:5, 1 Timothy 5:20, 2 Timothy 4:2, Titus 1:13, Titus 2:15, Eph 5:11)
We should "purge out the old", because allowing poison among you will poison everyone... allowing those who continue in sin among us will destroy us. (1 Cor 5:6-7)