Why twirl a stick? There is a reason for this if done properly; it isn't just to look cool. First, the downside. It can leave you open to a high counter if you're not careful. Timing and positioning are important considerations.
The reason to twirl is to generate power in a very compact motion compared to a linear strike. If I throw a #1 strike (high right forehand) in a linear motion from a fully retracted position, my hand travels approximately 20 inches. I can add some arc, either by cocking my wrist or positioning the stick over my shoulder. Both add power, but affect timing because my hand has to travel the distance, and the over-the-shoulder position leaves my face unguarded. A twirl moves the tip of the stick a tremendous distance, further and more quickly than retracting and reversing direction.
Let's do some math. The circumference of a circle is pi (3.14) times diameter (C=pD). If I have a 20 inch stick, the diameter of a twirl is 40 inches but the distance the tip travels is approximately 10.46 feet! That greater distance allows tremendous acceleration. With a 28 inch stick, the tip covers some 14.65 feet! All this is done with minimal hand travel; add a short "pump" to the motion and the effect can be devastating.
I've often demonstrated this by having someone hold out their stick for me to strike. First I hit it in as linear a motion as I can, as though I'm throwing a punch, a relatively weak hit given the lack of mass in the stick even compared to impact from a fist. Then I tell them to hold on tight as I strike with a twirl, moving my hand as little as possible. If the stick doesn't fly out of their hand (I warned them to hold on tight!) they'll certainly feel a much greater shock. If that had been their wrist, the fight likely would have been over.
Of course there are other reasons to twirl, such as reversals around blocks or for secondary hits to targets, or to hide intention before attacking a target, but as a hidden way to hit hard, it's something that is often overlooked.