Bill removes profit motive from incarceration and marks latest clash in state’s battle with Trump over treatment of immigrants