Potato peels have nutrients. If you're trying to feed an army, why waste a bunch of nutrition and food stock? In TV and movies, it's long been a trope of a single person getting punishment and sitting next to a mountain of potatoes needing to be peeled.
I found this photo documentation of soldiers peeling potatoes back to the early 1900s, although it's not apparent that it's a punishment and most don't appear to be an official KP duty. Those photos are before science knew about glycoalkanoids, but it was common knowledge that green potatoes could make people sick. So peeling could have been a way to reduce poisoning.
So did the military peel potatoes to prevent against illness of green/sprouting potatoes? Did people get military punishment of peeling potatoes? It seems people have been eating baked potatoes a long time (skin and all), but most industrial preparations of potatoes is mashed with peeled potatoes. Is eating potato skins a more modern convention?
Edit: forgot to add the link to photos. It's there now.
In the Swedish army, there were three kind of people that worked in the kitchens at the garrisons (in the field was a completely different matter, then the army had a supply organisation that handled these matters).
First there were civilian employees, often female, that handled cooking and dishes, serving and other such duties in the kitchens and mess hall. These were headed by a Husmor (roughly Mistress of the House), usually a stern older woman that had the werewithals to handle not only a large staff but also the logistics of large delivieries, cooking and serving, budgeting and dealing with hundreds of endlessly hungry teenager conscripts coming to eat the food the kitchens provided.
Secondly, there were Handräckningsvärnpliktiga, (roughly assisting conscripts) according to the defence plans of 1925 and 1936, men who were not considered fit for frontline military duty due to a lack of wits or physical impediments were categorised as such and depending on the defence needs of the time either freed from conscription or placed as handräckningsvärnpliktig, meaning they would recieve a very basic military training focused on defending themselves and their local garrison and spend the rest of the time as military clerks, doing cooking, cleaning, dishes, horse and vehicle care, administrative work (such as depot clerk, garrison receptionist/guard, typewriter, administrative clerk, secretary, mail sorter and deliverer, file worker and so on) or work to maintain the garrison such as building repair, painting, carpenting, ditch digging and so on. These soldiers, often slightly deragatory referred to as malajer (after the British usage of Malay people as military labour) would often be found in the kitches, working the simpler tasks of cooking, such as preparing potatoes. This system was abolished in 1981, as it was considered "grey" or forced labour. Any civilian duties not directly related to military matters had to be done by civilian employees from then on.
Thirdly, soldiers could be punished for slight breaches in discipline, failure in duty or just bad performance with kökshandräckning (kitchen assistance) - this was not always a punishment. The Husmor could ask for some extra hands and an officer would command a few soldiers to lend a hand. These men were often young, and inexperienced in the kitchen (as many men were in the early 1900s, considering cooking a woman's work) and were thus put to work on heavy tasks unsuitable for the female staff (such as moving heavy delivieries to the larder) and simpler tasks - such as peeling potatoes and vegetables.
So, a young man in grötrock (roughly porridge coat), a simple tunic pulled over the uniform to protect it when doing dirty manual labour would be a common sight n a Swedish garrison kitchen from the introduction of conscription in 1901 until the end of civilian labour as conscription (and punishment) 1981.
However, manual potato peeling was quite rare as it was time-consuming when feeding hundreds of men - the garrison kitchens were well-equipped and would have electric (such as this or hand-cranked potato peelers to do their poato peeling.
While potato peels do indeed contain a lot of nutrients, that was not always widely known during the early 1900s and traditional Swedish cuisine often calls for potatoes with gravy and for the potatoes to be peeled, as it looks more appetizing and is easier to mash them into the gravy then. People would either boil the potatoes with the peel on and then peel them at the table or peel them before boiling them. Peels also have a slightly bitter and very appetizing taste. See for example a traditional serving of Swedish meatballs with gravy, boiled potatoes, pickled cucumber, lingonberry jam and cream gravy. In the military, the time-frame to eat could be small, especially with a mess hall and the next set of soldiers coming soon to have their turn at eating and having hungry men sit and peel potatoes at the table might not be considered efficient time use.