An explosion, possibly involving a malfunctioning water heater, lifted the roof off a Santa Ana high school gym Tuesday morning and sent students scrambling for cover just before the start of classes.