A smart mailbox in Apple Mail is not a mailbox in the sense of “a place where messages are stored.” Rather, a smart mailbox is a “saved search” across multiple actual mailboxes. When you’re viewing a smart mailbox, the message list shows the name of the mailbox that actually stores the message.
Thus, a smart mailbox that searches for unread messages will, by default, also find unread messages in the Junk mailbox. To avoid seeing spam messages in your Unread smart mailbox, make sure it’s set up as follows: