Others with the same problem:
https://discussions.apple.com/thread/253708650
No good solution but one person responded there with
They can't because these are coming in as SMS texts using a loophole in that system and that system is entirely under the purview of cell service providers and the FCC. If your carrier supports it forward them to 7726 prior to deleting them. And write to the FCC, your carrier and your congressional representatives. If the spammers find that device makers are abandoning the SMS rules and blocking ones from gmail they will then switch to Yahoo and other email providers.