Resource limitation drives spatial organization in microbial groups