Markets also cannot account for externalities. If those externalities are something you care about (e.g. the environment you live in) - you need regulation.
Economies of scale abound in most markets, and this tends towards monopolies and regulatory capture. If you don't want monopolies, because you value your freedom as a consumer - you need regulation.
This is very basic economics - I wish it was more widely taught.