It is illegal for the boss to do that. State child labor laws specify that school things take precedent...and slimy employers take advantage of the fact that most people don't know what the law says. That is why it is more difficult for students to get jobs at places that are not slimy...because those employers will follow the law, and will hire someone else who won't have that conflict.
*NOTE* this is different from a student that needs to work to help support the family.