I suspect most people are completely unaware that there was anything like a sumptuary law back in the Middle Ages, laws that were pass, in order to primarily maintain class distinctions and to control, modify, and to keep in their place the middle as well as the lower class as to what was or wasn't allowed to be consumed for food, or worn for clothing, or purchased in general. It material life wasn't unfair enough already, the ruling class, wanted to make it quite clear that only they could wear certain clothes or to consume a particular food, so that class distinction was readily maintained by certain visual clues.
The ostensible reason for these laws was to encourage thriftiness in purchases by these unentitled peoples, to maintain social structure, and to enforce humility upon them. Although sumptuary laws are a thing of the pass, their application in certain ways is still relevant today. For instance, top line foreign cars are made for a specific type of person and aren't suppose to be driven by those that don't have the appropriate status to purchase them, that is to say that those people aren't really the intended buyers of said vehicles. This also applies to housing in certain areas of cities, and to other hi-end personal purchases, their advertisements, their catch, is all meant for a certain segment of the population and to a certain extent, to a particular further segment of the population that includes "up-and-comers" and to a small extent "wanna-be's".
The class distinction in the Middle Ages was not something to be trifled with and the sumptuary laws were meant to make sure that people knew their place and that they did not have the effrontery to assume that they were equals at any level with the ruling class. Furthermore, trade and other areas of commerce help to make some of the more common people, successful, perhaps a little too successful, but the ruling class wanted to make it quite clear that no matter the money, nor the intelligence, nor the accomplishments, nor the work ethic, that you could not demonstrate outwardly your positive change in fortune.
After all, the ruling class was accorded a specific respect as were those in the clergy that often worked in conjunction with the powers-to-be, so that neither had an interest in seeing their authority challenged or confused in any way, form, or function. After all, if somebody else dressed or ate in the manner of the ruling class but wasn't part of that class, the rulers believed that therefore the entire edifice was threatened by this breach of decorum, in which it might be shown, that those not of that class, could comport themselves in such a way that they appeared to be of that class, indicating or implying perhaps that there was not such a huge distinction between peoples as the ruling class would have you believe.
This means that in the Middle Ages there was no room for a true Cinderella story, that your upward mobility was not only limited by station, but also by what you were permitted to wear, or to eat, or essentially how you were able to comport yourself. While official sumptuary laws are a thing of the pass, fragments and images of them still exist in our world today.