This is an example of Newton's third law of motion.
If the upward force of the floor acting on the teacher were NOT equal and opposite to the force of gravity, then the net vertical force on the teacher would not be zero, and she would be accelerating, either up or down. While this would certainly be amusing and unforgettable for the kids in her class, it would have a great and impractical impact on the pedagogical potential of the daily situation.
The kids, in turn, would be in no position to laugh at anything, since the same law of motion is keeping each of THEM planted in his seat, and none of THEM is accelerating up or down either.