Markets are good. They are the best way we know of matching supply with demand.
More than that, market forces cannot be ignored. Not indefinitely anyway.
But markets do not automatically produce the most desirable outcomes, as the examples I gave earlier indicate, and they don't produce the fairest outcomes. Sometimes this is because of market imperfections such as manipulation by cartels, monopolies, criminals or whatever, and one way to address them is to ensure the market is properly competitive.
Other times, however, markets give undesirable results even though nobody has misbehaved. There are the familiar examples of road signs and lighthouses - goods which benefit the public, and help markets, but which markets won't produce of their own accord. There is also the problem of the pollution created by economic activity and who should pay for it. I could go on.
A further category of reasons why market intervention is needed is that we are social beings, not simply buyers and sellers in a market, and so we try to protect people from the worst consequences of the market. If some people are unemployed, or unable to work, or the market won't pay them enough to live on, we think it right that they should receive some help.
The very act of doing these things changes the outcome of markets without necessarily impeding their efficiency, and that is a good thing. Markets shouldn't rule. They should certainly exist, but they are there to serve society, not the other way round.