You might be running into this Apple Mail bug where Mail sometimes deletes messages instead of moving them. You can work around that by following the instructions at the bottom of this page to make sure that Mail is set to store all the Junk mailboxes on the server and to move the spam messages to the special All Junk mailbox.
Wow, thanks so much for this!! Making the suggested configuration changes worked. All of my test emails aren’t immediately deleted any longer! I’ve been beating my head against the wall looking for the culprit. Your quick note made my day. FYI, I’ve been using your software for over a decade (SpamSieve, EagleFiler, and ToothFairy) and it’s rock solid. Thanks for all you do!