Combat operations are hard and grueling work. The amount of calories expended are incredible. It was discovered very early on that the nutritional requirements are far above the normal diet of the average person. Consequently, combat rations that could provide a density of calories and carbohydrates in a very small space with a very long shelf life would be preferred and easier to provide.
Candy and chocolates fit that quite nicely
The same goes for fats and proteins – which is why canned meats such as SPAM and powdered eggs and milk were provided to many theaters. It got so bad for my Dad who served the entire war from Dec 7 1941 until early 1946 in the Pacific theater that when my mother (who was only in theater as a nurse from 1944–45) would buy Spam and put it in the pantry, my dad would find it and immediately throw it away.
This little battle went on for years. He couldn’t stand to have it even on the shelf