It's the classic German Stoßlüften in action.
However, the air outside also has lots of dusts. Opening the windows does nothing for that, but air filtration can potentially help.
Though for us the ceremony was only one or two mild complaints from the kids near the window, and the teacher firmly stating that the room reeks of sweaty teenagers and needs some airing out.
And rain? What's the problem with opening a window when it's raining? Only if there's a rain storm... and not even then, depending on wind direction.