Cooperation is typically seen as the ideal outcome in a social dilemma. Because cooperators are vulnerable to exploitation, much of the literature has focused on mechanisms, such as spatial structure, that support prosocial behaviour and the production of public goods1–11. Yet the rules for distributing these goods also shape behaviour and long-term prosperity. Here we study policies for allocating public goods, comparing equitable allocation, in which returns are proportional to potential contributions, with uniform allocation, in which all individuals receive equal shares. For most social networks, we find that uniform allocation facilitates the spread of cooperation compared with equitable allocation. But this success comes with a cost. Uniform allocation concentrates resources in a small number of highly connected individuals12, whereas peripheral individuals receive fewer benefits and may even be worse off than in a non-cooperative society. We develop a theoretical analysis of the tension between cooperation and equality, and we identify this conflict across diverse empirical social networks. Our results show that inequality may be an unavoidable consequence of allocation policies designed to foster cooperation in spatially heterogeneous populations. The question of how to promote cooperation is therefore incomplete: because policies that facilitate cooperation can also generate social stratification, we must weigh the benefits of cooperation against the inequality that accompanies it.