Understanding how communities emerge is a fundamental problem in social and economic systems. Here, we experimentally explore the emergence of communities in social networks, using the ultimatum game as a paradigm for capturing individual interactions. We find the emergence of diverse communities in static networks is the result of the local interaction between responders with inherent heterogeneity and rational proposers in which the former act as community leaders. In contrast, communities do not arise in populations with random interactions, suggesting that a static structure stabilizes local communities and social diversity. Our experimental findings deepen our understanding of self-organized communities and of the establishment of social norms associated with game dynamics in social networks.