A vice in common can be the ground of a friendship but not a virtue in common. X and Y may be friends because they are both drunkards or womanizers but, if they are both sober and chaste, they are friends for some other reason.
"Don Juan", p. 403 - The Dyer's Hand, and Other Essays (1962)