In the United States (and in many other countries!), there are several professions in which it is illegal to practice without a license. While most states typically handle these schemes, even Congress was afforded the power in Article I, Section 8, under the Commerce Clause, making such schemes even potentially federal.
For obvious reasons, you want quality control in regards to your doctors and lawyers. I can sort of even see the justification for funeral homes - having needed to use two in the last six months, no matter how prepared you are, you are using them in a time of acute need, and there is a case to be made that you want regulation to ensure you are not taken advantage of.
And, most professions have a vested interest in restricting the pool of potential purveyors, in order to bid up prices for the remainder. Indeed, lawyers in particular have sought to "raise the bar" in order to deal with a glut. And again, doctors are paid more when there are fewer of them. But for any one industry with an incentive to restrict professional practice, there is typically a wider electorate that presumably doesn't have the incentive to see prices rise. And, in a democratic system, one would assume that cartel power would, in the long run, be voted out. After all, self-interest amongst consumers (and their sheer numbers) should serve as a check.
But here again, there seems an obvious anomoly. A barber or a haridresser is a licensed profession in many states and countries. The work is not particularly skilled (one can earn a degree in less than a year), nor is the industry particularly prone to horrendous side effect in the event of a bad apple. (Any hairstyle by Lady Gaga, Cher, or Hillary Clinton notwithstanding.)
Why then, do these licensures remain? What is the incentive for the average person to support an artificial monopoly amongst an otherwise low skilled profession? Why not require janitors and sanitation engineers to be equally licensed?