This is because many who engage in wrongdoing love those who join them in it and hate those who do not. This is evident in corrupt religions: each group shows allegiance to those who agree with it and hostility towards those who oppose it. Likewise, in worldly pursuits and desires, people often prefer and favour those who share their pursuits and desires.
This may be because they seek assistance in these things, as with rulers who gain power by force, highway robbers, and the like. Or it may be because they enjoy others joining them, as with those who gather to drink wine: they like everyone present to drink. Or it may be because they dislike someone distinguishing himself from them through goodness—whether out of envy, or lest he rise above them through it and receive praise rather than them, or lest he have an argument against them, or because they fear that he will punish them himself or through those to whom he reports their conduct, and lest