Using a 3 HP inverter to run a 2 HP spindle motor would be fine. If you want to
be fussy about it, you might check to see if the inverter has programmable
overload (of the motor current) sensing to protect the motor from overheating,
and set that for the smaller motor.
If it is a used inverter, you might start by resetting all parameters to factory
default in case the previous user had done any strange setups.
Also pay attention to the operational voltage. There are a lot of 460 VAC
industrial surplus inverters that are likely not suitable for use at home.