I was about to ask how this can even be legal and then I realized this is an actual law that went into effect on January 1st in Illinois.
If your child has an account on a social networking website, e.g., Facebook, Instagram, Twitter, ask.fm, etc., please be aware that State law requires school authorities to notify you that your child may be asked to provide his or her password for these accounts to school officials in certain circumstances.