No one really seems to know what causes Twirling/Star Gazing. It may be a virus, bacteria, yeast infection, or some other chemical/physical imbalance in the finch's body. It appears to strike at random and without warning or past history of problems. Someday, if all of the answers are found I will most certainly inform you all about it.
We do know that Twirling is most common in Gouldian Finches but it has been seen in a few other species as well.
The signs of twirling are pretty simple to spot. The finch will appear dizzy and will roll its head from side to side, even upside down. You will notice a gradual and steady loss in balance. The read rolling will worsen and the finch will find it difficult to move about the cage. Eventually being unable to fly or perch. The end result is death.
It is best to move the twirling bird to a hospital cage as soon as you can. The twirling will only get worse over time and eventually the finch will not be able to perch. In time the finch also be unable to find the food and water dishes even if you place them on the floor of the cage. This is when the finch usually dies, as a result of starvation. However they can also die from attempting to fly and smacking into something hard enough to cause injury.
From this point out, breeders tend to disagree on what should be done next. Many breeders simply skip the whole hospital cage and just have the bird put down (culled). It's quick, humane, and often the only thing to do as the Twirling worsens.
Others try to treat the birds before any drastic measures are taken. Because the exact cause of the Twirling is unknown, the treatments have been random and haphazard at best. Antibiotics, antiprotozoals, probotics, you name it, it's been tried. The only problem with these treatments is that don't usually work. Plus Twirling finches don't have other symptoms of illness unless they actually are sick with something in addition to the twirling.
Of course it's possible the cause isn't illness at all but rather an inner ear problem. The total loss of equilibrium can result in the same symptoms. Some part of it could be dietary but no direct link has been found to my knowledge. That's not an excuse to feed your finches poorly, a poor diet could easily be a contributing factor. It is likely that the condition can be passed on from generation to generation. The trait to be susceptible to twirling is a genetic risk. Finches that have been cured of twirling shouldn't be bred.
False diagnoses of Twirling can also occur. Something as simple as too much Calcium in a bird's diet can result in a ‘drunken bird' look. When a finch is placed in a small cage for the first time or is stressed they may also roll their heads from time to time. The only difference between that behavior and true twirling is that the behavior is intermittent and gets better over time.
Now there has been some progress in the treatment area. In fact I've come across two possible treatments.
A drug called Nystatin seems to have cured twirling on several occasions and even in some of the worst cases of it. The Nystatin suspension is actually a treatment for a fungal or yeast infection but it has shown promising results for several breeders now. I suggest you read Don Thorschmidts article "Successful Cure of Stargazing/Twirling" for more information about this treatment.
The next is another drug known as SMZ Liquid or Trimethoprim Sulfa given one drop a day for two weeks has also proven to be effective.
Thankfully, I personally haven't had to deal with this condition much. I had only 1 Gouldian hen that exhibited signs of Twirling many years ago when I was first starting out. Sadly back then I didn't have the resources I have now and the female died.