The city of Florence (circa 1400) used to enforce laws preventing people from wearing certain kinds of fabrics in public.
These “sumptuary laws” were designed in part to maintain social hierarchies, but also served as a way for governments to take more money from people.
At first, Florence used fines to prevent people from wearing fabrics that didn’t align with their social standing, and then those fines morphed into fees since many preferred their clothing choice over money.
Then these fees became licenses where citizens could entirely avoid the hassle of paying individual fees for their clothing choices by paying a single annual fee, or ‘gabella’.
This comes from Virginia Postrel’s book ‘The Fabric of Civilization’