They do move out. That's what Hillbilly Elegy describes: the migration of "hillbillies" from Kentucky to industrial towns farther north (in that case, Middletown, Ohio). So many young, working age people have moved from my state, there are few left but the elderly and the welfare recipients. Doesn't do much for the tax base.
Most or many of the small town residents around my area benefit from the ag industry. Some have a few industries like poultry processing or making furniture. Some have tried to gear up the tourist industry which I guess brings in a little money.
But for the most part they're meant to be small towns. Nothing inherently wrong with that at all. In fact as long as I can get internet services and be not too far from grocery stores, medical facilities, etc. I'd rather live in a small town. Right now I basically live out in the country with a farm on one side of my property.
It's just when some residents of the small towns complain about there being no industry or jobs that I would like to remind them there most likely will never be much in the way of good jobs for many small town residents.
Like anything else, if you don't like your situation, work to improve it. Adapt to the situation or move.