It is important to have some degree of regulation in addition to the "safety net" that the first two posts discuss. Regulation is important in order to avoid what economists call "negative externalities."
Negative externalities exist when there are bad effects of economic actions that are not paid for by the people involved. An example of this is if a company pollutes the air and my child gets sick because of that pollution. I bear the costs (sick child, medical care) of the company's actions even though I was not part of their economic action. These externalities cannot be cured by the market because the company has no financial incentive to stop polluting. Therefore, the government must step in to prevent the company's desire for profit (a major part of capitalism) from harming me.