A town with ten people won't have five grocery stores in the first place. Nobody's going to spend a bunch of money to open a store in a place where there isn't a customer base to support it.
The point is that business decisions aren't magically correct. People can, and do, open stores in oversaturated markets. When your cupcake shop flops, that's sad; when hospitals close, that can be devastating to a community. It makes at least theoretical sense for states to try and prevent that impact.
Avoid the impact from hospital closures by preventing them from opening in the first place? Hospital closures are devastating if they're the only one in the area, or remaining facilities don't have enough slack. They aren't devastating in an oversaturated market.