Why would I want to allow anonymous access to Trac? And how to enable it and manage it?
This is a decision that should not be taken lightly. Opening your Trac instance to anonymous users will require you to carefully manage what they can see and do in Trac.
However, it can allow you to create a community for your project allowing any user to access documentation easily, file tickets/bugs for your project, and much more.
I did enable anonymous access, now I'm getting spammed...
First you can limit the access and actions that the anonymous user can perform. If you limit the anonymous user so it cannot create Tickets or add wiki content, then you close the doors for spamming.(see Trac Anonymous and Authenticated Permissions.
But what if you still need to allow anonymous users to enter content to your Trac?
Once you have enable the SpamFilter plugin, you can tune it from the Trac itself. (Login to Trac as an admin > Under trac.ini: spam-filter > tune it as needed)
There you can set 'karma' point limits, set service keys (ie: akismet, reCaptcha), etc. For more details on tuning check this article Tuning your SpamFilter plugin.