More to the point, the Court focused on the speech restrictions those laws are based on.
This case is emphatically not about schools outing children. This case is about government restricting and compelling speech, which is always problematic.
The problem is NOT that the state law bans automatic notification. The problem is the opposite, that the law bans any notification.
The problem with the law is not about compulsion but about restriction.