How to hide or clear unread badges on Gmail folders in Mail.app?

Solution 1:

Create a filter in Gmail (web settings) to automatically mark all spam emails as read.

Solution 2:

I don't know how to make the badge go away but a way to reduce the number of the unread messages if they're spam is to modify the settings on your gmail account on the web. Settings/labels/spam/show/hide in IMAP. Uncheck show in IMAP google's settings list for labels