While she without question has the right to free speech, the challenge is not to her right to speech, but to her right to use the particular forum for her speech. We obviously don’t have a guaranteed right to a public forum. The event, graduation, is not a right either. A school is perfectly within its rights to issue diplomas without ceremony.
So, the speech by the valedictorian is a tradition. Since the school is providing a ceremony with the intent of recognizing scholastic achievement, it has the right to set the parameters for that ceremony. Perhaps the school believed that the speech was too outside the focus of the ceremony. It is also possible that the school felt the speech was too exclusive and narrow in its applicability. Since the ceremony is an optional service offered by the school, the school, I believe, has the right to insist on certain conditions to make the service broadly acceptable.
Also, complaints such as the one this young lady made are not often thought out very well. Would they object to an atheist who talked about how his rational understanding bloomed after rejecting faith based conjectures about the universe being cut off? And what is a possible consequence? If the controversy is too disruptive, a school would be within its rights to remove the valedictorian speech as a part of its graduation ceremony in order to preempt any future conflicts. Sometimes, choosing your battles is more important than making a futile statement.