Recent research suggests that WWI essentially acted as an incubator for Spanish Influenza. The outbreak could have originated from the trenches and while those with mild cases would have stayed at war, containing the disease, those with more severe cases would have been sent home, spreading the disease all over the world. Once the war ended, those with undetectable cases would have returned home, spreading the disease further. Additionally, in general during and immediately after WWI people were moving between countries far more than ever. Therefore, even those without symptoms could have spread the disease without realising. Spanish flu was one of the first 'global' pandemics, while previous pandemics had been contained mostly to countries or continents.
WWI could have actually protected thousands of people from the disease. Many men would have built up antibodies from being around the virus for such an extended period while in combat.
[P1] Because of WWI, far more people were moving around than ever. [P2] Because of this, the pandemic spread globally and killed millions.