The ruling undermines California’s Safety Act, which bars school districts from adopting “forced outing” policies.