The free market should be thought of as an optimization algorithm. Ideally, the government's role should be to set up a constrained optimization problem, which attempts to align profitability with human well-being (e.g., "provide people with whatever material comforts they want to pay for, under the constraint of not poisoning them and not polluting the environment"). The market's role is to solve the constrained optimization problem, and if the incentives set up by the government are good, the optimal point of profitability should reasonably approximate an optimal point of human well-being.
The error of so-called free market proponents, is that they want the government to set up an unconstrained optimization problem. The market will find some kind of optimum, but without intelligently designed constraints (i.e., regulations), there's no guarantee that optimal profitability should correspond to optimal human well-being.