Spatial heterogeneity increases the importance of species richness for an ecosystem process