I have a vague recollection that PH detection requires amplification circuits and is very sensitive to any voltage drop, such as might be caused by running a pump, as you observe. If you want to fix it, it will need to be done electrically.
But I don't think you need to. Your code can read the PH and then decide what to do. While one of the motors is operating, ignore the PH reading. A little state machine may help.