1) The purpose of that capacitor is to reduce the amount of noise (RFI) transmitted by the wall-wart charger.
The charger was certified for all the dozens of legal requirements WITH that capacitor.
If you remove that capacitor, you will likely be increasing the amount of trash thrown out by the charger.
2) It is true that the presence of that capacitor will quite possibly create a path for unwanted voltage from the power mains.
And, as you say, that is quite undesirable to allow that "sneak current" into sensitive loads.
However, remember that those little wall-wart charger gadgets were designed for a "floating" load (your cell phone) which is connected to nothing else.
3) Those little wall-wart chargers are NOT appropriate for circuits like yours which are sensitive to this leakage current through the capacitor.
If you were to dissemble the little wall-wart charger and put it into a metal box with a proper 3-wire mains cord and plug, with the proper connection for the green-wire safety earth/ground that would eliminate the undesirable sneak-current.
Note that even SOME wall-wart (or line-lump) chargers with proper 3-wire connection to the power mains (including the green-wire safety ground) do not connect the green-wire ground through to the DC output. This is especially a problem with portable computers when you try to connect them to a separate sound system, for example.