>Why are people paying those workers?
In short, in modern, mainstream economic theory the ideas that explain this are what's called Market Failures. In 2001, the Nobel Prize in economics went to people who studied information asymmetries, which lead to market failures.
A concrete and classic example is the Tragedy of the Commons.
My earlier example of the financial sector, which in 2008 showed everyone how private gains created public losses in the form of subsidies, recession, inflation, bail-outs, moral hazard, public-sector risk, was created despite (and many argue in part, because) of government-oversight.
Another, more benign example, is one I was reminded of while on vacation in France. A toilet bloc was guarded by an unhappy attendant who took 1 euro per use. It would be better to install a 100euro toll gate and give her the remaining profit to buy a computer to play video games (or art supplies, whatever she wants to do), in the hours between cleanings. Everyone wins. This is what's called pareto-efficient. Someone is made better off and no one is made worse off (tourists don't need to encounter an unhappy attendant, either).