I think the point is that many malls have toilets completely open to the public (no payment to keep out "undesirables") and manages to keep them nice and clean.
I would guess that it's because the confined space of a mall makes this this efficient to staff.
Firstly, there are multiple toilets within a relatively small area, so one cleaning team can service multiple toilets. Secondly, the small area of a mall minimises travel time (wastage) between toilets. Thirdly, in places where keeping the toilets clean doesn't take enough time to keep the cleaners occupied full-time, there are other general cleaning tasks to occupy them.
It's also worth considering the deterrent effect of footfall and supervision: if the toilets are used frequently, and checked/cleaned frequently, people are less likely to carry out wanton acts of vandalism, for fear of getting caught.
If you take the example of a city with public toilets on the streets, either each toilet has to be staffed, which would generally be expensive/inefficient, as each toilet wouldn't require a full-time cleaner, or you would need a cleaning team to travel from toilet to toilet, spending time stuck in traffic, looking for a parking space, etc.