Police said the 17-year-old student acted out of revenge, inspired by white supremacist and neo-Nazi attacks.