I use Mail with my Gmail account via IMAP. I like having everything synced, except the spam and trash folders. Is there a way (either on the Gmail end or mac end) to prevent some folders from syncing with IMAP?
Yes you can do this in the Gmail settings. I did this a long time ago for the same reasons. Just log into your Gmail account through your browser, go to Settings and then the Labs section. Enable the Advanced IMAP Controls, then go to the Labels section in the Settings and you will see a whole bunch of new options for controlling what IMAP will display in Mail, or any other email client.