The Motor spins in one direction to spin, and drain/pump water, it spins the other way to activate the normal reciprocating washer action (=Wash Mode). The water pump drains the washer only when rotating in "spin" direction
This is controlled by a ratchet (correct name?) at the bottom on the tub below the 'transmission' (gearbox).
The action of the ratchet is to raise the drive shaft to engage the 'Wash Mode' of the gearbox/transmission.
This gear may be stuck, or the transmission may be worn/damaged and not allowing the gearbox to correctly select the agitation mode.
The following image shows the ratchet in mid position. Rotating the shaft in the correct direction either drops or raises the drive to engage/release either the spin mode or wash mode. (Tub rotates clockwise in spin mode, reversed in wash mode).
You may have discovered that if the washer spins at full speed in wash mode (when it should be agitating) water will not be pumped out, as per normal pump action but will over-spill the top with centrifugal action, and flood the area.
Hope this helps someone.
Ref Kleenmaid KAW651 model (Photo is 1992 Model)