Why do spam folders show up
Mac Pro, iOS 11
From the Mail>Help window
Use Smart Mailboxes to organize messages
A Smart Mailbox displays messages that are stored in other mailboxes and that meet certain criteria you specify. For example, a Smart Mailbox could include all the messages you receive about a specific project, regardless of which mailboxes the messages are stored in.
If you change a message in a Smart Mailbox—such as marking the message as read or unread, or moving or deleting the message—the change is reflected in the mailbox where the message is stored.
If you use iCloud Drive, your Smart Mailboxes are available on your other Mac computers that have iCloud Drive turned on. For more information, see Store your desktop and documents in iCloud.
See alsoCreate or delete mailboxesRename mailboxesUse rules to manage your inbox
Do you really have that many accounts?
They appear to be the the Spam folders for the individual accounts, and you have the individual accounts set to store Junk on the local mail folders instead of the account server Spam folder (Mailbox Behaviors).
If that is all same account, you are not using the server spam folder but some obscure Junk folder inside your Inbox. Nobody but Apple calls it Junk, so I assume you created that folder yourself. Since you are not unifying the server spam folder, it is showing up under that account, just like any other unattributed server folder.
Why do spam folders show up