Spatial dynamics of ecological public goods