There are ways of making money ethically, and failing that, legislation is there to keep things in check. This is why (in most of the developed world, at least) you don't see people in the street fighting & robbing each other all the time.
I agree it's not 100% perfect, and things do slip through the cracks; including in cases of big tech companies that move too fast compared to legislation and so can get away with what is essentially large-scale fraud, tax evasion, privacy violations, etc.
But the idea is if the market itself cannot solve the problem and it's causing significant harm to society then legislation is supposed to step in to prevent the behaviour deemed harmful.