Lafayette, the general who fought in the American Revolution, had a full name of "Marie-Joseph Paul Yves Roch Gilbert du Motier, Marquis de Lafayette." The Duke of Nemours, son of King Louis-Philippe, was "Louis Charles Philippe Raphaël d'Orléans". Why are their names so long?
Before I start, the study of given name is severely lacking especially concerning socio-cultural aspects. That said, my knowledge is based on French literature so if I missed something in English and somebody points this out, I will revisit the following answer.
Although traditions and other symbolic customs were important, there were no obligations for nobles to name their children following a specific pattern such as X number of names. It was entirely up to the parents if not only the father. The individuals bearing long names like La Fayette are eye-catching of course but one should not forget the legions of nobles who had only two names (like most of the population) or even only one. The Count of Vergennes was just Charles like his son was Constantin. The Marquis de Puysieulx’s name was Louis-Philogène and the Count of Adhémar was Jean-Balthazar. So many had long full names, but it should not be considered something mandatory (either by law or by traditions).
Traditionally, names are supposed to reflect three aspects: honouring the family, honouring the king/the royal family, honouring and placing the child under the protection of God/the divine/the religion. A last category also exists, it can include original, new or even exotic given names meant to stand out. Family, blood and age of a lineage is everything to the aristocracy, it is the most important criteria when it comes to knowing other families and judging them. As such, referring to one or more ancestors deemed to be illustrious is common. Of course, the aristocracy has a much longer familial memory, even if a little mythical from time to time, then the lower social categories who very often cannot remember more than two generations before them. However, religion plays a very important role in naming children as well.
La Fayette is actually a pretty good example. Marie-Joseph was a reference to two of the most important people of the Bible. Marie was one of the most popular given names, for boys almost as much as for girls. Roch is for Saint Roch, who appears to be an important Saint locally as there is a Saint Roch Church in Chavagniac-Lafayette (the Marquis’ birthplace). As for Yves and Paul, I cannot say. But Gilbert is a reference to an illustrious ancestor. Since the Marquis’ military career was very admirable, the choice was a good one! We can operate the same analysis with the Duke of Nemours. Louis is for the importance of that name in the royal family, more specifically for Louis XVIII who happened to be his godfather. We could speculate about Charles, although it’s a common name and Louis XVIII’s brother was Charles (X). Philippe is an important name for the Orléans family. Raphaël is both an original name, unique as far as I can tell, and the name of an archangel. His older brother, the Duke of Chartres, also had a unique and rarer name, Eric Rosalino, while all Louis-Philippe’s children had the long list of names: Ferdinand, Louis, Philippe, Charles, Marie or Marie-Thérèse for the princesses.
The same pattern can be applied to commoners. Many had two names, often a reference to the family like a grandparent and/or to their godparents and finally a saint for protection for example. Nobles could afford to be more extravagant than a peasant, for example, the latter would be more subject to social and cultural pressure from the community and the priest who may not approve of an exotic Greek divinity name. A long full name made to meet all these “symbolic” criteria is not just specific to France. The best example is perhaps Spanish names. Many nobles or member of the royal family have extremely long names (much longer than French ones!) like the Duke of Anjou and Segovia Jaime Luitpoldo Isabelino Enrique Alejandro Alberto Alfonso Víctor Acacio Pedro Pablo María. There again, there is a long list of traditional names reminiscing his ancestors (Alfonso, Isabelino, Pedro) and reference to religion with Maria. Todos Los Santos (of All Saints) is not a rarity in Spanish royalty as well.
Finally, naming children is a liberty parents can take. La Fayette’s son Georges, for George Washington, is a good example of how influential the personal choice of the parent is. This liberty to choose which and how many given names helps to create a family identity. Sometimes individuals have four or five given names, sometimes only one, more often two or three. Is there a pattern among families to give many names or just one or two? It deserves a study which does not exist. Sadly, studies of given names among the nobility are rare and in terms of sociology and culture, non-existent as far as I can tell. It is important because there are customs that influence their decision and that are mostly related to honouring one’s lineage as well as giving divine protection to the child. This can easily be seen. Genealogists have conducted local studies of given names, some historians as well, always locally. Unless I totally missed it, a broader approach of the importance of given names to the nobility (or even in general) is yet to be made. There are several interrogations that could help answer your question better such as the influence of humility. Did it influence the number of given names or is it an idea that is shaped by our modern mentality to think that a long list of names means nobility? It is hard to answer. However, we can see that it is fair to state that in the years before the 19th-20th centuries first names were not really supposed to shape a person as an individual but rather as a member of a community (religious, a family). Therefore, people had names of saints that were important to them as well as the names of illustrious ancestors. This is probably why nobles had more reasons to give a large number of names to their children should they wish to.
I hope this helps and answers your question (and that my rusty English is good enough to be readable)