Certainly one reason for shaving during WWI is the fact that it was the first war to see chemical agents used on the battlefield. Soldiers had to use gas masks for the first time. In order for a gas mask to fit properly, you need to be clean-shaven. The army bought millions of Gillette razors and blades to make shaving possible. When all of the soldiers returned from WWI with their clean-shaven faces, they were heroes. They appeared in their home towns, and they also appeared in newsreels in the new movie theaters that had sprung up everywhere. Combined with ad campaigns from companies like Gillette, it became the fashion to be clean shaven.
Between 1920 and 1960, beards were definitely unfashionable. That taboo has eased somewhat since the 60s, but it is still far more common for men to shave than not. And as you can see, it is strictly a fashion statement, and largely the result of advertising by companies like Schick, Norelco and Gillette.
Or, to put it another way, no one makes any money if you have a beard…
Some info on how facial shaving became normalized.