Moving spam to online folder

I’ve set the rules in Apple Mail to move mail that SpamSieve identifies as spam to an online folder in a gmail account, instead of to a spam folder on my Mac. I check my email on several devices, and having the spam located in one folder that’s easily accessible on all the devices is preferable to having the mail hidden away on only one device.

The problem is that the mail continues to go to the spam folder on my Mac, and does not get moved to the gmail folder. When I first created the rule, I had the mail going to the spam folder on my Mac, but I later changed the rule to have the mail routed to the gmail folder.

Any ideas why this isn’t working?

Please see Step 3 of Using a Spam Mailbox on the Server