You have to remember that this was an age before radio, let alone TV, video and mp3 players. People went to music halls for their entertainment and sang songs that were easy to learn.
During the war, a large number of songs were written that could be sung as marching tunes by troops and also by families at home. They included "Keep the home fires burning", "It's a long way to Tipperary" and "Don't Take My Darling Boy Away".