Why doesn't SMS spam go to the Unknown Senders tab on iPhone Messages?
From Apple documentation:

You can filter iMessages from people who aren't saved in your
Contacts.

There is difference between iMessages and SMS/MMS. You can read about it in Apple documentation: About iMessage and SMS/MMS
Based on that it is relatively safe to assume that if you have SMS (text in green bubbles) then filtering doesn't apply.