You are asking why glass is transparent. On the quantum level, there is a debate on this site what really happens. I will give you the explanation that I find to be logically right.
The answer to your question is on the quantum level elastic scattering. This is the only way the photons:
keep their energy level
keep their phase
keep their relative energy level
keep their relative angle
If you look into a glass window, you will see two things:
a coherent mirror image of what is on the other side of the window, this is what you are asking about, the glass seems transparent
a specular reflection, that is a mirror image of yourself. In this case the glass is acting as a mirror.
Now how can a glass window do both at the same time? Be transparent, and be a mirror too?
The solution is elastic scattering. In the case of a glass window acting as a mirror, this is called a specular reflection. Specular reflection (mirror image) is elastic scattering.
Now what is the difference between when the image goes through the glass, and when it is reflected? Only the angle. They are both elastic scattering. In the case of the glass being seethrough, photons get elastically scattered through the glass. In the case of the glass acting as a mirror, the photons get elastically scattered off the mirror's surface.
Now you are asking why the motion of gases does not affect the mirror image. In the case of air, this is called an elastic scattering too. But the real reason why this does not matter and the mirror image is kept, is because the speed of the gas molecules' motion that you are asking about, is almost zero compared to the speed of photons. Remember photons always travel at the speed of light in vacuum (and they are traveling in vacuum inbetween the molecules) compared to any object that has rest mass. Now all the molecules do have rest mass, so the photons are traveling at the speed of light compared to them (molecules). Since the molecules' speed is negligible compared to the speed of the photon's, the motion of the gas molecules do not affect the mirror image. Photons fly through the gas as if the gas molecules were not even moving at all.