The state law closed the loophole the politicians left in the federal do-not-call system. Yay for the state.
The state could have accomplished the same end by banning all robocalls that the recipient didn't specifically sign up for. Since that wouldn't be based on the content of the calls it wouldn't be subject to this particular 1st Amendment challenge. By banning politicial robocalls in particular they guaranteed that the law would be found to violate the 1st Amendment.