I’ve had this problem with Mail in Mavericks, however I assumed then it was just a Mail.app glitch. It also happens in Yosemite so not sure now.
What happens is that mail will come in to my Gmail account and be flagged as spam. However, instead of being moved to the spam folder on my mac and then deleted from my Gmail inbox, it seems to be copied there. So now there are two copies of the spam message, one in the Spam folder on my Mac, and one copy still in my Gmail inbox.
This doesn’t happen if I manually ‘Train as Spam’. If I do that it moves the email to Spam and does delete it from my inbox.
I’ve attempted to mess around with various Gmail settings and Mail.app settings and nothing seems to work.
I’m having the same problem
I’m having the same problem since upgrading to Yosemite. Spam messages are shown in the Spam folder and also in the Inbox – the same messages. I can also manually mark the ones in the Inbox as Spam and they will be erased from the inbox. Then they only exist in the Spam folder as they should have in the first place. If I run “apply inbox rules,” this DOES NOT work.
I’ve now seen a few other reports like this. It seems like there is a general problem with Apple Mail under Yosemite sometimes copying messages (not just spams) instead of moving them. As the problem seems to be related to moving messages from a server mailbox to a local mailbox, it may help to switch to using a spam mailbox on the server.
I ended up doing a complete re-install of Yosemite (for other reasons) and just starting from scratch (didn’t migrate my data). Everything seems to be working now.