There is a check valve at the city connection that is to stop water from exiting there when the pump is on. Most likely that valve is stuck open allowing water to back-flow out.
Once fixed it is a good idea to turn the pump off while hooked to city water. I say this because during periods of low city pressure, in under supplied campgrounds, the pump will come on and unnecessarily draw you tank down.
I have taken the valve apart for other problems and you might try that as a first attempt to fix.
WBCCI 12156 AIR 3144 WACHUNG TAC NJ6
2004 Excursion 4x4
1991 34 ft. Excella +220,000 miles, new laminated flooring, new upholstery, new 3200 lbs axles