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.