While public resources might have been better spent in other ways, being brought to trial over swearing and using profanity isn’t what the first amendment is about. It is a limitation on the FEDERAL government’s ability to stifle those who might speak out against IT. You know, like the unconstitutional Campaign Finance Reform law, passed with the help of McCain and Thompson, that limits free speech during elections.
The public use of profanity certainly can and should be regulated by LOCAL government if that is what the local population votes for.
Local governments have limits on their authority to regulate profanity (see post #97). The judge ruled correctly in this case.