One must remember that when Louis was a small child, the French nobility engaged in a coup, known as the Fronde, against the crown. His mother and Cardinal Richelieu barely escaped with their lives, and the young Louis was severely traumatized in much the same way that Peter the Great was by the palace coup against his mother and her relatives in his childhood.
Louis grew up knowing that the only way to secure the safety of himself and his dynasty was to quash the political aspirations of a fractious nobility. In fact, Versailles was enlarged into the "gilded cage" it became under Louis for largely political reasons. Louis needed to cut the senior nobility off from their bases of support in their regional estates, and he devised the plan of luring them to Versailles.
In pursuit of that aim, he created both positive reinforcements and negative consequences relating to Versailles. For reinforcement, he made Versailles the center of culture and entertainment in France. It had to be a lush, never-ending -- and ultimatly addictive -- parade of music, art, high society, games and sundry other diversions. On the consequences side of it, no one who did not spend a considerable portion of their year in or near Versailles had any hope of receiving lucrative appointments for themselves or their family members, state pensions, or other preferments.
Part of Louis' plan was to make life at Versailles so ruinously expensive for the nobility that they would be devoid of funds with which to raise private armies or pursue other political agendas. Hence the ever-escalating elaboration of dress and entertainment expenses, the encouragement of high-stakes gambling, etc.
The primary reason Louis developed such a ponderous court etiquette was to give the nobility something to connive and fight over other than real political power. If he could make the right to hold the king's right glove during the Grand Lever more desperately sought after than the right to hold the king's left glove, then he could effectively emasculate his nobility. He did just that.
It was initially a brilliant strategy that bought France several generations of respite from civil war. It was also a strategy that developed a life of its own, living well beyond Louis' need for it and ultimately contributing to the collapse of the monarchy.