Sometimes when you train an uncaught spam message in the inbox as spam, the message will move to the spam mailbox and then appear to “bounce back” to the inbox. That is, the same message (not a new one that looks similar) will appear again in the inbox and no longer be in the spam mailbox. Usually, the same thing will happen if you move the message via drag and drop rather than training it with SpamSieve, which indicates that it’s a general problem with moving messages rather than something specific to spam filtering.
Typically, this means that Apple Mail and the mail server did not successfully move the message in the first place. Mail moved the message locally, but it did not get moved on the server, and so the next time Mail synchronized with the server it reinstated the message in the inbox.
Sometimes this is caused by a problem with Mail’s database, and you can fix it by doing a complete rebuild of the database.
Other times, most commonly with Gmail, there can be a problem moving the message from the inbox (on the server) to a local mailbox (the Spam mailbox under On My Mac). We recommend Setting the Junk Mailbox in Apple Mail.