Military strategy and tactics are forced to constantly play catch up to technology and context. Looking at history, it helps to take off the hindsight goggles and meme filter and look at why people did what they did, with the resources they had, with the goals they were given.
There were many missteps and mistakes, some of them were simply bad, but WW1 is very prone to being reduced to memes that strip away any nuance and only magnify the failures.
To be fair, the French military published a very brilliant and prescient paper on the nature of the coming war and the tactics it would require a handful of years before the War broke out... and the brass proceeded to completely ignore that paper in favor of 'tried and true' tactics.
Pigheadedness and tunnel-vision may not be stupidity per se, but it's close enough that few observers are going to care about the difference.
If there's a single period of military history where contemporary and future experts agreed that the military leaders of the time were mostly blood thirsty and delusional morons who did not care how many people their inbred and willful idiocy got killed, it's WW1, so that's a pretty forgiving take for some of history's most ineffective commanders.
1911s (and their ammunition) were already on hand. It is easier and faster to create a non-precision piece that attaches to the grip than it is scrounge up entirely new weapons and ammo.
Not like this lasted long anyway. In short order planes began getting proper armament.