You probably have a Shurflo 4008 Revolution water pump. It has a built in back flow with a valve to keep the pressure from fluctuating. You might be able to stop it by adjusting the cutoff on the bypass valve on the side of the pump as per the instructions on the Shurflo website which is an easy allen wrench adjustment. Just keep track of the number of turns you make with the allen wrench so you can set it back to where it was, if needed. I have had this problem on two trailers. Changing the check valve did not help.
Before adjusting, I made sure that any water coming back out of the fill tube did not leak to inside the compartment by putting a wrap of thin silicone putty from Lowes around the fitting and the 2 clamps. Then tested by putting filling, putting the cap on and waiting for the overflow. That way it is only a nuisance if it does overflow.
The other adjustment is on the check valve at the front of the pump, you can adjust it to lower the input water pressure. I just tried this adjustment and will be using my trailer soon and will post back the long term results. This problem needs a solution.
Hope this helps