It is illegal and this is not the first time California has done this. It is also illegal for states to sign agreements with Indian tribes but it also happens.
"Show me just what Mohammed brought that was new, and there you will find things only evil and inhuman, such as his command to spread by the sword the faith he preached." -Manuel II Paleologus