You have one of two problems: Either the starter drive on your starter is defective and is not engaging the flywheel to crank the engine, or the flywheel has some broken or damaged teeth that are preventing the starter from engaging.
Starters come in a variety of designs. On some, the solenoid is mounted on top of the starter. When you turn the key, the solenoid routes current to the starter motor and at the same time pulls a lever that slides the drive gear mechanism out so it will engage the flywheel and crank the engine. If the solenoid is weak or damaged, it may not be strong enough to overcome the spring tension that retracts the drive gear. So the starter spins but doesn't crank the engine.
On other starters, the solenoid is mounted remotely. When the starter motor starts to spin, it ratchets out so the drive gear will engage the flywheel and crank the engine. If the drive mechanism is damaged or hung up, the motor may spin but not crank the engine.
Regardless of what type of starter you have, it will have to come out for further inspection. The drive gear (which is sometimes referred to as a "Bendix drive") should move out when the starter starts to spin. The drive gear usually has a one-way clutch that is supposed to protect the starter against damage if someone keeps cranking the engine once it starts. The gear should turn one way but not the other. If the gear is locked up or turns freely either way, the drive is bad and needs to be replaced. If the drive can't be replaced separately, you'll have to replace the entire starter.
If the drive seems okay, the starter should be "bench tested" using jumper cables or special equipment designed for this purpose.
CAUTION: Be careful because a starter develops a lot of torque. It should be held down with a strap or clamped in a vice (be careful not to crush or deform the housing!) before voltage is applied.
A simple no-load bench test can be performed with a battery and a pair of jumper cables to see if a starter motor will spin. But this test alone won't tell you if the starter is good or bad because a weak starter that lacks sufficient power to crank an engine at the proper speed (usually a minimum of 250 to 500 rpm) may still spin up to several thousand rpm when voltage is applied with no load.
A better method of determining a starter's condition is to have it tested on equipment that measures the starter's "amp draw." A good starter should normally draw a current of 60 to 150 amps, depending on the size or power rating of the starter. Some "high torque" GM starters may draw up to 250 amps, so refer to the OEM specifications to make sure the amp draw is within the acceptable range.
If the starter does not spin freely, or draws an unusually high or low number of amps, it is defective and replacement is required.
An unusually high current draw and low free turning speed typically indicate a shorted armature, grounded armature or field coils, or excessive friction within the starter itself (dirty, worn or binding bearings or bushings, a bent armature shaft or contact between the armature and field coils). The magnets in permanent magnet starters can sometimes break or separate from the housing and drag against the armature.
A starter that does not turn and draws a high current may have a ground in the terminal or field coils, or a frozen armature.
Failure to spin and zero current draw indicates an open field circuit, open armature coils, defective brushes or a defective solenoid.
Low free turning speed combined with a low current draw indicates high internal resistance (bad connections, bad brushes, open field coils or armature windings).