One of the easiest ways to lose your balance when spinning is by swinging the free leg. Inexperienced spinners tend to swing the free leg in the hopes of generating power for the spin. However, swinging the free leg makes it incredibly difficult to stay balanced during the turn.
The better way to use the free leg during the turn is to squeeze the thighs together, which closes the free leg. As an added bonus, squeezing the thighs also tightens your core, which will improve your balance even further.
The Drill: Take a side step and put your weight entirely on one side. Prep your turn by rotating your shoulders slightly in the direction you want to turn and holding your hip back to create torque through the body.
As you release the spin, concentrate on collecting the free leg straight into your supporting leg by squeezing the thighs. Be sure that your leg is collecting directly in. If your free foot moves around the supporting leg at all, you are still swinging the leg. (Your body will rotate around the supporting leg, but the free leg should not move any further forward or back of the supporting leg than the rest of your body.) Check your ending position: the ankles of your legs should be pressed together.
You can work this drill into any of your other spinning exercises. Focus on squeezing the thighs together during every part of the turn in which you gather your legs.
Bonus Variations: It is also easy to swing the leg on the way out of the turn, as you step down the slot. Make sure that your leg goes straight out. If you attempt to send the leg down the line too early, you will have to swing the leg in order to finish your rotation. Focus on finishing the rotation, then sending the leg down the slot.