Pleading not guilty does not prevent you from taking traffic school, but the county isn't obligated to let anyone take traffic school either; it is within the court's policy to disallow traffic school for any reason.
But practically, that's pretty rare. The threat of it shouldn't be enough to keep you from fighting the ticket, if you feel you have a chance at beating it. But before you even think about going to court to fight it, always try trial by declaration first here in California. Works a reasonable portion of the time, and if you lose you still have the right to fight it in court if you choose, and traffic school is usually available afterwards either way anyway.
Useful thread on local motorcycle site.