The justification offered is always the same: to protect the consumer. However, the reason is demonstrated by observing who lobbies at the state legislature for the imposition or strengthening of licensure. The lobbyists are invariably representatives of the occupation in question rather than of the customers. True enough, plumbers presumably know better than anyone else what their customers need to be protected against. However, it is hard to regard altruistic concern for their customers as the primary motive behind their determined efforts to get legal power to decide who may be a plumber.
In this same vein, Reason has an article on the Oklahoma case where the state's requirement that casket sellers be licensed morticians was challenged legally:
Memorial Concepts Online sells an oak coffin for about $2,000, compared to an average of around $4,000 at funeral homes in Oklahoma, where the company is based. By separating the purchase of caskets from the purchase of funeral services, Memorial Concepts can offer substantial savings, not to mention a shopping environment free of hovering morticians. But in Oklahoma, which allows caskets to be sold only by licensed funeral directors, such competition is illegal.