Here is the part number for your motor, part
389248.
WHIRLPOOL
389248 Direct Drive Washer Motor, part number:
AP2907974

You may also find this topic helpful.
Video: Whirlpool Washing Machine Drive Motor Replacement.
Why would the motor work on other cycles but the spin?
The motor turns one way for the agitate cycle and turns in the reverse direction for the spin cycle. The motor will not get any power if the lid switch is bad.
Also if there is anything stuck between the wash basket and the outer tub it could keep the washer from spinning. Feel around the inside of the tub towards the top to make sure something did not get caught in between the two tubs.
Can you hear the motor hum like it's trying to run during the spin cycle?