This is the picture in question.
The photograph is from after World War I. Article 169 of the Treaty of Versailles required that:
Within two months from the coming into force of the present Treaty German arms, munitions and war material...in excess of the quantities allowed, must be surrendered to the Governments of the Principal Allied and Associated Powers to be destroyed or rendered useless.
These helmets are being rendered unfit for military use.
I believe your premise that this photo is taken from during WWI is likely inaccurate, and is rather from just after the war. Conditions laid out in Articles 159-213 of the Treaty of Versailles restricted Germany's future military, naval and air power to a level many times smaller than it reached during and in the run up to the war (See this table).^1 Concurrently, it also called for the handing over of various military equipment to the Allied powers.
The pictured helmet is the Stahlhelm, which was the standard issue German helmet from about 1916, replacing the traditional leather Pickelhaube. As war materials, these helmets were not exempt from the above articles in the Treaty of Versailles and this led to the destruction of some 60,000 helmets.^2 This is what we are seeing in the image above. Unsurprisingly, military helmets with holes in them aren't particularly effective!
As for why this method of destruction was employed, rather than say melting them down, I can only speculate I am afraid.
Sources: