1st amendment. There's a long history of carve outs around commercial products. But, if Linux devs (who aren't selling anything) went to the mat against this law, the government of California would lose and (at least part of) their law would be struck down.
Kids deserve free speech. There is no valid reason to deny access to them to social networks. First amendment is being breached here.