Spatial aggregation of competitors over resource patches is generally accepted as an important mechanism maintaining coexistence of species in insect communities exploiting fragmented resources. However, its quantitative effects on local diversity, i.e. the relationship between the degree of aggregation in a community and community diversity, remain unexplored. In this paper, we tested whether stronger spatial aggregation does lead to the predicted higher local diversity. We compared six species-rich Drosophila communities exploiting decaying fruits in central Panama, monitored over one full year (> 25 generations). We found a clear positive relationship between the overall degree of aggregation and community diversity. In addition, aggregation over fruit trees was found to contribute greatly to the overall degree of aggregation and was largely responsible for the observed relationship between aggregation and diversity across communities. In addition, both diversity and aggregation strength were lower in communities in disturbed habitats, which was explained by altered spatial distribution of fruiting trees. This study shows that the aggregation model cannot only explain coexistence, but also differences in local diversity.