Because the parents may be really transphobic and it might put the kid's life in danger.
Some school districts had implemented policies that forced teachers to out students to parents even when they know that would be problem. This law prevents that but still allows them to notify parents.