There are numerous reasons for the military. First, I recommend you look up the name "Baron Von Steuben". He created the first Drill and Cermony book for the military. Basically D&C was created to move soldiers and equipment from one training site or battlefield to another in a swift and organized manner.
Following orders also instill discipline within the ranks. Orders come from the top ranks down to the lower ranks. Following those orders ensures everyone is on the same page to get the task done in the most efficient manner possible. If someone does not follow the orders given for a task and decides to do the task in their own way, the risk of failure is increased and more likely. It can have a very costly outcome
The first lesson of leadership is learning how to follow orders. That is also providing that the leader you are following knows what they are doing, and in the military, that can be a tricky question. If you do not learn how to follow orders, you will never be trusted to give them. It's something called character-based leadership. It is also taught at all of our military academies (i.e. West Point, Annapolis, Colorado Springs and New London).
Following orders is essential to the proper operation of "the machine."
There is a chain of command giving everyone an area and depth of responsibilty.
Orders are called orders because that is exactly what they are, not suggestions. In the heat of battle, following orders saves lives. There is no time to think it through or suggest other options. Your sergeant gives an order and he expects it to be followed as well as when you might give an order to your subordinates. That is one reason why basic/boot seems so scary to some people because they know they will have a power struggle with the drill sergeants. It's all about submitting your own free will to the good of others. If an order is not followed, the results of delay or disobedience could be as serious as causing the death of a squad to something...