Try us - I'm curious.
You're given a semi-trailer-sized shipment of heavy "product" (whatever it may be). You're directed, along with a half dozen other troops, to empty the truck (by hand; nothing is on pallets) and put the items in the "yard" at location X.
You get about half way through with the truck 2 hours later, and you're told actually the items would go better at location Y. You start moving them. An hour later, it looks like the contractor screwed up and sent you some of the wrong stuff; nobody bothered to check beforehand. You re-load half the truck.
Another hour or so goes by and the Commander decides that since the contractor screwed up one item, you're just sending it all back. You spend a few more hours re-packing the entire truck.
You just spent hours doing something you should have never done in the first place, but it was really important to finish it quickly, which actually, ironically, caused it to take far longer than it should have, due to constantly conflicting orders.
In general, there is a lot of "move stuff here, okay never mind, move it here." or "do this, okay new orders from the top, do this instead" or "do this because it was ordered, even though everyone here knows it will be reversed next week".
You can see this taken to its logical end when it comes to in-country Units replacing each other. Basically, anything and everything the previous Unit accomplished is completely negated and thrown out by the incoming Unit, as they Do Things Differently, Thank You. People wonder why we don't make any lasting progress and the answer is really simple: Ego. Ego and people covering their own asses constantly instead of doing what they know needs to be done.
</rant>
If you ran everything at full efficiency you would need far fewer people - but then in a war there would not be enough people. So you do everything inefficiently so the people (and resources) are there when you need them, and in a war you press the magic efficiency button.
Take your examples:
The loading/unloading was a form of exercise.
Sending the full truck back was a way to keep the truck drivers busy, and also of making sure the trucks are used.
Sending the entire shipment back was a way of keeping the supplier occupied, so that they need to keep people on payroll, who would be needed in a war.
The thing about the in-country units, was actually a form of training - you want each unit to know how to accomplish the entire task. Sure you could use the previous work, but then the incoming unit would not know how to do it. Plus it keeps the incoming unit busy, and everyone, and everything else associated with it, both busy, and in practice.
A unit commander has a big problem: how do I keep my soldiers both busy and trained. The simplest way to do that is to make them redo things someone else already did.
Try looking at all the inefficiency in this light, and it will all make sense.
PS. Were you ever a commander/officer (not sure of the right term)? Or did you ever keep children occupied in the summer?
Uh, no, this was a war-time example. So were my notes about "incoming Units". When we were relieved in Afghanistan, our work was pretty much thrown out, despite the fact that we'd had the most successful deployment (in terms of native opinion improvements, processes improved, etc.) of that theater in years (for our AOR anyway).
While I appreciate the logic of your argument in theory, I assure you, there is no such thing as a "magic efficiency button", which any actual soldier will tell you (or rant to you about) for hours ;)
It's interesting to read the thoughts from people on HN, RE the military, because they are almost universally preposterous.
I wouldn't trust my life to a general who hadn't also successfully run a company full of people who didn't care what he thought and quit when he did something stupid. You may be an experienced military X, but you'd probably be a better X if you also knew how to do X as a civilian. In fact, you'd better be ready to do X as a civilian when your service is terminated, however that may happen.
Despite our constant fervor to rush, nearly everything involving the military is ridiculously and irreparably inefficient in ways that outsiders probably wouldn't even believe. Although, I am mostly cognizant of the fact that it takes a hell of a bureaucracy to keep the wheels turning, even if it makes those wheels rusty in the process.