The alternative is a central authority setting prices, which has historically had disastrous results.
The market forces that determine pay are more competition between folks that hire others to clean toilets. If all of your competitors pay twice as much as you, you might not have quality employees... or any at all, if a job is readily available. If you have a lot of folks desperate for income, you can pay less. If there are few folks that are willing to clean toilets, you probably pay more. You could go without folks to clean toilets, but your average Western accountant probably isn't going to clean the office toilets or breakroom willingly unless it becomes standard for office jobs everywhere. Many places simply cannot leave dirty facilities - and in some jobs, you probably would rather have separate staff cleaning (hospitals, for example).
Luckily, there are a lot of levels between "unregulated, free-market-will-take-care-of-it" and complete control from a central authority. Minimum wages, worker rights, workplace safety, safety nets that ensure less desperate people, and so on.
We can redistribute profits from investors to low wage workers like the people who clean toilets, but the consequence of that is lower return on investment, and with it, lower rates of investment/economic-growth.
In the long, policies that lower economic growth rates are very detrimental to all classes of workers. What increases wages for people like toilet cleaners is high levels of production relative to population.
Investment is the mechanism by which we increase production, and profits are how 1. resources are distributed to those who are most effective at growing the economy's level of production 2. people are incentivized to invest to increase production.
There's no escaping economic laws, and no free lunch from policies that redistribute income from high income earners to low income earners.
Other compensation that I'd accept instead - social status, respect, ability to spend my time in beautiful places and talk to interesting, educated people, opportunities to work in interesting buildings or locations, opportunities to work for organizations that I believe in, ability to have more kids, and live in a community that sees childrearing as a community responsibility. All these things are easier to find if you have money, but they're not exactly things money can buy.
Another way is to keep the free market as a price discovery mechanism, but introduce a mechanism that counteracts the tendency to accumulate wealth.
Raising the income of a toilet cleaner doesn't correspond to a general rise in prices. It might mean the development of self-cleaning toilets, which isn't a bad idea.
The public bathroom still needs cleaning itself, though. Unless you're suggesting that a Japanese toilet is a robot that cleans the whole bathroom? That would be interesting!
I once had a summer job as a manager of this issue - my job was to find a cleaning company and assure quality in one company building (roughly 500 toilets, around 30 cleaners). From my experience, these people were unable to properly do their jobs (not the cleaning part, stuff like opening windows so the toilet doesn't smell like acid and actually dries, not forgetting to clean something...). None of these people would be able to or would want to invest the time to learn to repair the incredibly complex Japanese toilets - they will rather live on welfare. Of course it's anecdotal and I'm sure that a lot of people will do just what you said - most certainly not everyone though, and there won't even be place for everyone, rather like every hundredth at most.
> Unless you're suggesting that a Japanese toilet is a robot that cleans the whole bathroom?
Yes, there are "toilet boxes" that can clean the whole thing including floor, ceiling and walls.