This is likely due to capillary action drawing the syrup up the tube from the bottle - viscous syrup + a narrow tube = strong capillary action. Since it's one of those pesky laws of nature, there's not a lot you can do about it.
You might try transferring the syrup to a container with a wider pump tube (since capillary action is stronger in a narrow tube). Or you could transfer it to a container with a tap attached (like a keg) rather than a pump, but that prevents you from using measured doses. Finally, by the looks of it, the nozzle on the bottle might rotate, so you might also try turning that to point upwards and hope gravity keeps the syrup in place.
Failing that, the only other alternative would be to keep a drip tray underneath the pump to catch the syrup, then replace it in the bottle, but I imagine that has food safety implications, not to mention being a PITA.