For much of the 20th Century, squad drill was the bugbear of visionary firearms designers. Great emphasis was placed by the using services on the training maneuvers and positions that had been developed in the previous century, but which were rapidly becoming irrelevant.
The reason there was such emphasis on drill in the 20th Century was due to their importance in the 19th. To help get a sense of why, it helps to look at the 19th Century drills themselves. The YouTube channel britishmuzzleloaders has a very thorough overview of British bayonet drill from the twilight of the muzzle-loading era, the 1860s, including reenactment of the drill in full Highland Regiment uniform:
Today, these sorts of exercises are easy to dismiss as quaint or silly, but in the past they were the foundation of an effective fighting force. Ever since the Roman era, and until the invention of modern communications and weapons technology, the supremacy of the well-disciplined unit was recognized, and these drills were essential to the creation of a disciplined body of men that could fight together as a unit in the face of pike or horse.
In modernity, discipline is built in other ways, and while unit cohesion and discipline is still key to an effective fighting force, its overwhelming importance has been reduced due to the more fast-paced nature of technological development that characterized warfare from the late 19th Century onwards. The nature of infantry combat, too, changed, and bayonet is no longer being taught at all to the troops of the major powers (though the bayonet as a weapon still should not be entirely discounted).