I want to echo SharnHarte that perhaps you are getting some sort of signal interference. The sensor uses ‘interrupts’ to detect flow pulses. If the wire is sending pulses unexpectedly due to signal interference, that could be interpreted as flow pulses.
When you leave only one cable in the sensor, you should try both ports of the rain sensor: one of the port is circuit ground (I think it’s the one on the right). I assume if the wire is left in that port it shouldn’t have any interference since that’s the circuit ground. You may have left the wire in the other port (which feeds into a microcontroller pin) and that is prone to interference from ‘floating’ signals.