Paul is still discussing in this section the purity of the local church but as a by product he talks about who Christians have as their friends.

It's an important lesson. Hope it helps you.