You missed the key phrase "for the purposes of immigration enforcement."

If they're looking for a load of meth, it's fair game.

It's not a key phrase. It's alleged that this particular violation was for that purpose.

The law itself - https://calmatters.digitaldemocracy.org/bills/ca_201520160sb... - doesn't specify immigration purposes.

https://www.404media.co/ice-taps-into-nationwide-ai-enabled-... also indicates a number of specific requests had "immigration" as the given reason.