Check the safety switches.
The most common problem is the switch under the seat.
If it is not activating all the way, then you will not have any spark, so it will just spin and spin.
Also check the switches on the brake / clutch pedal (did not look to see if it is a hydro, but it does not matter, because there is still a switch either on the pedal or the linkage that the pedal controls.
Next switch to check is the one on the pto or the blade engage.
The blades can not be on for it to start. If the switch thinks the blades are on, it will not start.
ALSO, always check to see if the wires going to these switches are frayed or if the insulation is getting bad. They can not short out or you shall get intermittent results.
If this dose not work, then you will probably look at the ignition system as in electronic ignition module.
It may be intermittent or there could be a loose wire.