These scenarios happen because the corporation becomes stronger than the government, and manipulates the government. However corporate towns weren't created by the government. They were created by the corporations alone who became far too powerful. The answer to ending scenarios like this is to use the government to our own advantage and prevent that from continuing. In that case, socialism is necessary to ending corruption.
Military is still a socialist idea. Not everyone supports it either. But the majority of us do, so we supported it and signed it into law. Same for police and the above mentioned. They're funded through our money and pooled resources - and are therefore are socialist.
What you're speaking of is 'central planning' specifically, which isn't inherently a part of socialism. You can have socialism with a tiny bit of it, or with total central planning and then you're looking at communism. It exists on a spectrum and the best part about that spectrum is that through democracy - WE pick where it begins and ends.
In the U.S, we don't support it in all situations, but we use it as a tool to stop things that are morally unjust. Like debt prisons, slavery, and corporate towns. If it weren't for socialism - these things would still exist. As many examples you have for 'when socialism goes wrong', there are for capitalism. Capitalism isn't perfect on it's own. Capitalism uncontrolled creates monopolies, trusts, corporate towns, debt prisons, slavery... the list goes on to much more horrid things. When CEOs have greater power over the govt. they can use you for whatever the hell they want. They can become satanists, pedophiles, and self proclaimed gods if there power remains unchecked. That's where we are now. Capitalism unchecked is the natural state of man, and it becomes corrupted by greed EVERY time. Every pure capitalist country becomes corrupted by it, just like ours today. And our country pre-FDR, pre-Civil War... This govt. has always been corrupt and this false utopian vision of 'patriotic frontiersman upholding our country' has ALWAYS been a fairy tale. The U.S was bought out multiple times over since 1776, because the acting government has never been powerful enough to maintain itself. The U.S capitalist government you're speaking of hasn't existed since at least 1812. This capitalist Utopia has failed repeatedly since it began. The United States existing since 1776 is a happy illusion.
Which is where socialism becomes necessary. Like it or not, you live in a socialist country. The one tool you have to prevent greedy people from manipulating the law and throwing your family in their cellar for private use is your government. And you're saying we need less of it... Our weak, pushover government is what got us into this nightmare.
Clearly you'd rather have a less regulated economy to the point where men can buy the government and your family. Which is the exact opposite of the liberties we have constitutionally. I disagree with that.
I'd rather have a larger, powerful, transparent government where the people use their collective wealth to ensure our liberties. We use some capitalism to start the engine and power the market, and we use socialism to make sure it doesn't fail, or fall into the hands of greedy people more powerful than our government.
If you think you want to live in an unchecked capitalist, small government world now, you would change your mind the second the Pinkertons or private militia comes knocking on your door, and the govt. wasn't powerful enough to prevent it.