Why did people wear gas masks in World War 2?
They didn't. There was a great fear that poison gas would be used against civillian population centres or on the battlefield. It did not happen in WW2.
During the First World War both sides had made extensive use of chemical weapons on the battlefield. With the development of heavy bombers it was feared that poison gas bombs would be used on civilian populations. Thus people wore, or at least carried, gas masks in case of a chemical attack. As it was, neither side used chemical weapons at all in the second war.