According to Wikipedia there are at least 120 films set in and involving WW I. Bear in mind that almost everybody who fought in that war is now dead, so recent wars are more alive in our collective memories.
Also, film was in its infancy at the time of WWI so fewer films were made, and many that were have been forgotten. In addition, many of the early films were not only in black and white, they were silent films, not talkies. It’s all I can do to get my kids to watch a black and white film, but forget silent films. They simply can’t sit through them. So, obviuosly they don’t get very much play these days.
A few of the more recent ones not already mentioned include The Lost Battalion (2001), Regeneration (1997) aka Behind the Lines, My Boy Jack (2007), The Trench (1999), Darling Lili (1970), Deathwatch (2002), Company K (2004), Archangel (1990), Black and White in Color (1976), Biggles: Adventures in Time (1986) and The Curious Curse of Benjamin Button (2008).
Plus, as others have said, the Nazis make such easy bad guys, and the black and white SS uniforms with highlights of red from medals are so beautifully cinematic.