If Apple ever implements SMS anti-spam that actually works, I'll buy the upgrade it a heartbeat. It's been a solved problem on the google side for years so it's clearly not impossible.
I saw a setting to detect some spam that I toggled on sometime back. I don't know if I'm just getting less spam period, but I feel like maybe it helps? It's hard to tell.
The new OS (with Liquid Glass) has SMS message categorization that works fine to filter spam IME. You still have to delete them if you don’t want the red dot, but at least I don’t get alerts any more.
I upgraded iOS just for this feature and am glad I did. Not a fan of Liquid Glass, though.