Humans are social beings; people are predisposed to join groups, categorize the social world into groups, and prefer fellow in-group members over out-group members. Social groups in turn compete for individuals and especially for the resources of individuals to maintain the cultural practices and symbolic markers of the group. We modeled the effect of this competition on population level cooperation. Using game theoretic and network science methods, we found that groups would develop and maintain norms that restrict their members to join other groups. If every group can maintain such norms against every other group (the topology of the group-network is complete), the society is composed of closed communities which do not cooperate with each other. Changing the topology of the group-network can yield larger cooperating components within the population, because, in this case, members of antagonistic groups can join a third group, thereby allowing cooperation between them. The results suggest that the individuals’ ability to join more than one social group is crucial for maintaining cooperation in large populations.