Suppose that you can vote in a referendum on a proposal. You believe that the proposal is good for the whole world, but bad for your particular group. For example, it might be a proposal to accept a trade agreement that would be beneficial on the whole but would hurt your particular business. Or it might reduce global warming but hurt the coal industry, and you live in a coal-producing region. How should you vote? The options are to vote for the proposal, vote against it, or not vote.
Assume that voting has a small cost. You must take the time to do it, and get to the polling place. Let us first consider only this cost and the effects of the proposal itself (regardless of whether you vote for it or not). The probability that your vote will affect these consequences is very small, but not zero. The expected benefit of a vote for one side is the probability times the benefit if your vote matters. It is well known that the expected benefit to you personally is usually not enough to justify the cost of voting, even though the cost is small. If this benefit and the cost of voting are all you care about, then, in terms of these values, you should not vote.
Now add the assumption that you care about other people, not as much as you care about yourself, but some. Clearly, if the proposal can affect enough other people whom you care about, it becomes worth the small cost of voting, in terms of these values. If you care equally about all other people, then (by assumption) you should vote for the proposal, because it is best for the world.
If, on the other hand, you care only about other people in your group, it could be worth your time to vote against the proposal. This conclusion is less likely for two reasons. First, the group is smaller. Second, many members of your group may care about outsiders, enough so that they would prefer the proposal to pass. Your caring about them should consider their altruistic values as well as their self-interested values, and this inclusion would reduce further the value to you of your vote against the proposal. Given these considerations, it is less likely that voting against the proposal would be worth your time, compared to the case in which you care about everyone equally. (You may also care some about the world but more about the members of your group. This would be in-between.)
More generally, though, this analysis suggests that people who care about the world are the ones who are most likely to find voting worthwhile, and these people should vote for the proposal. Those who care only about their group are less likely to find voting worthwhile, but, if they find it worthwhile, they should probably vote against the proposal (unless they think that most members of their group prefer the proposal to pass).
Note that voting against the proposal can be seen as a vote to harm the outsiders. (And not voting at all is a lesser harm, because it has half the effect on the outcome, compared to voting for the proposal.) From most moral perspectives, this harm is difficulty to justify. Thus, we could argue that the sort of parochial values that lead to this vote are ones to be discouraged. They are, in a sense, "evil desires".
Now consider the possibility that the act of voting has positive benefit to the self, as well as a small cost. This is, again, about the behavior of voting and not about the consequences of the adoption or rejection of the proposal. Suppose you get some pleasure out of cheering for your team, or from cheering for humanity.
Note that the pleasure of cheering could possibly be obtained without actually voting. You could, for example, go to political rallies and participate with the crowd in cheering one side or booing the other side. If you did this on the side against the proposal, you could get this pleasure without hurting any outsiders. However, it is possible that the pleasure is greater when you actually vote. This is part of the ritual. In this case, those who are motivated this way are selfish in a way much like those with parochial values. They take pleasure in behaviors that hurt other people, without (by assumption) compensating benefit for anyone else. This too is the sort of desire we have reason to discourage.
Moreover, it is possible (even likely) that the pleasure of acting on behalf of your group is based on a failure to understand or appreciate the more basic argument given above. People may think that supporting their group is the morally correct thing to do, in terms of the consequences of the proposal being adopted or not. If people were convinced that voting for the proposal is better in terms of its consequences, they would take less pleasure in voting against it.
Likewise, if people understood the low expected utility of voting against the proposal for others, even those in their group, they might not get enough pleasure from voting against the proposal to make it worthwhile for them to vote at all.