The Constitution is the supreme law, but it is not the only law. There is, for example, no prohibition against murder in the Constitution.
Does any government have the right to tell you where to go, when you must return home, when to go to bed, what to wear, what to read, what to watch on television? Parents are not only allowed to exercise that kind of control over children, but they're irresponsible if they don't. Schools take on some of the duties of parents when parents entrust children to their care.