That's why you use mixers. Good mixers will completely break the chain between inputs and outputs.
Why are mixers legal? The only purpose I find on them is to money launder. They are literally useless if you don't have anything to hide.
The mixer was not meant to serve scammers as a money laundering tool, it helps people to ensure the privacy of their money and to keep the money safe from hackers' attention.
But accidentally mixing is also a way for hackers to launder money. Just like Bitcoin, monero, dash, Zec ... these cryptocurrencies are not born to serve criminals but they have been used to launder money.
As well as money in your bank account. You have to pay taxes on your income but if you want privacy no one will notice you switching to crypto or anything else of value.
There are two sides to everything.