The company towns example raises a concern I have about an economic approach being applied too readily. The difficulty with economic analysis as it is often (not always) applied is that it omits the non-financial issues which clearly were important to people - it's like people who rely on Adam Smith but have read the Wealth of Nations, but never the Theory of Moral Sentiments. One needs to read both to understand Adam Smith's ideas fully.
Taking a British example, a number of nineteenth century industrialists set out to provide effective company towns for their workers. However, others did not. One distinction was that the owners of companies who created company towns were often methodist or otherwise "evangelical" low-churchmen and thought they had a moral (not financial) obligation to their workers.
Good economic analysis can incorporate such ideas as and motivations within it, but often the only way one realises that one needs to incorporate the ideas is by doing good history in the first place - starting from the economic perspective alone won't do it.
I agree with the overarching sentiment, but I'm not sure that what the commenter is suggesting is actually at odds with an "economic perspective."
Surely, there is a crude economic perspective that suggests that individuals are motivated by financial self-interest, or, from the Marxian perspective, class interest. But I don't think that this perspective has many adherents in neoclassical circles (I can't say that I'm up on the latest in Marxist theory).
The real economic puzzle here is "why have a company town"? A pat answer: because this allowed the "company" to exploit the workers, who had no bargaining power. Economically-oriented response: "Wait, that doesn't make sense, if the company was simply exploiting the workers, it could just pay them less." So "why have a company town?" If one answer is, "because some rich Methodists who were not accountable to shareholders thought it was their duty to 'uplift' their workers, even at the expense of greater profits," that is a perfectly reasonable ECONOMIC motivation, if we understand economics, as Ludwig von Mises famously suggested, to be the "science of human action."
"Economics," as I understand it, takes people's preexisting goals--be they venal, charitable, religious, racist, or whatever--as a given, and then assumes that people will try to achieve those goals in the least "costly" (in financial and other costs) manner. If a businessperson is acting through purely venal motives, trying to exploit his workers, one would expect that he will simply pay them less, rather than set up a Rube Goldbergesque scheme of local monopoly that will be less effective in achieving his exploitative goal. On the other hand, if a businessperson feels a paternalistic obligation to his workers, one method he may try is to establish a company town that will both provide basic social services to his workers, and also enforce moral norms that will make it more difficult for his employees to fall victim to drink, gambling, or other vices.
I'm at fault for not making this clear. I wrote, "economics teaches us that companies aren’t likely to do something that’s contrary to self-interest." I should have written something more like that "economics teaches us that companies seeking to maximize profit aren't likely to engage in widespread behavior that seems obviously contrary to that goal"--like trying to "exploit" powerless workers by setting up a company town, rather than simply reducing their wages. In my previous post, I provided a few plausible explanations as to why profit-seeking enterprises might nevertheless set up company towns. The "Methodist" example is another possible explanation--that maximizing profits was subordinate in some cases to other goals--and yet another possibility is that company towns were a risky and often temporary venture, and no one else may have been willing to invest the needed capital in housing and the like.
All of these are plausible answers to the company town mystery, and none are necessarily exclusive of the others; different explanations, or a combination of explanations, may explain any given town. Economics provides the tool to question the simplistic "exploitation" argument, and perhaps provide hypotheses to explore, but it takes good historical work to figure out what was actually going on. And that's why I think economics and history are allies, not enemies.