iOS has features for SMS spam blocking, but all of the proactive ones require the user opt-in (not enabled-by-default).

There are 3rd party block list apps, there is an OS setting to trust the filtering of your cell provider, and you can report the sender/content of a message directly to Apple for the first message from a new sender.