Further, the business could decide to buy the tools, supplies, and provide the plumber's van. In exchange for providing all these supplies (which are deductible for the business), there's a strong argument that the salary due the plumber is less than if he had to provide all those tools himself.
There's a fair amount of flexibility in determining how much of the total is salary and how much is dividends and that's why there's "nothing wrong" with the first example when properly applied. Saying a plumber worked 100 jobs for a penny-per-job is not reasonable, but there is a broad range of reasonable.
To put it in our field, suppose I had the fortune to create the next modest sized thing that was purchased by Facebook for $10MM in cash. Suppose that a team of 2 of us (me and one other) created this over a 1 year period and it was 100% funded by me (no VC, no angel, etc). Suppose that I paid the other person $200K salary for their efforts. How should the remaining $9,800,000 be divided on my tax return? Surely you wouldn't argue that my "salary" was $9,800,000, but rather my salary should be $200K and I should receive the $9,600,000 as non-salary compensation (capital gains in this case, presumably, but not W-2 salary).
Now why people need to resort to these practices to get more fair share of their brutto income is completely different topic, something around "voting with your taxes" about how public cash is spent (usually pretty badly). FYI, I don't do it anymore, got a perm job, but when I was doing consulting this way, I had all the possible support of my local tax office when something was unclear.
Finding a bright line differentiation between formation of a company for "legitimate" (what does that even mean?) reasons vs. tax avoidance/optimization is likely impossible. It's quite likely that even pursuing this in legislation would only result in a net loss due to regulatory burden etc. without any real gain.
If you ask about the schemes, the advisor will openly tell you they expect a ruling, ie there is some contention about whether it's actually legal.
A doctor typically has a staff, or may want to have the ability to sell the practice later on. If you make $600,000 a year, why should you have to pay 40-45% tax on that income when $250k will be invested back into the business anyway? Why should you be compelled to subject your spouse and children to the liability of the business?
A real estate investor will often setup LLCs to isolate the liability associated with one property from the overall portfolio. Again, a legit business use.
Obviously there are abuses here, but the fundamental concept isn't wrong. Typically the abuses are when there isn't a bona-fide business. Some financial dude setting up a shell company for his bonus is an example of a questionable use of this approach in my book. When a person sets up a chain of shell companies to obfuscate the ownership or transfer of assets, that's obviously crossing the line into money laundering territory!
Theoretically, a dividend is a share of the profit generated by the business. Salary is payment for labor rendered. They both exist for different reasons.
Personally, I also think that any dividends and capital gains should be taxed equally, or more, than salary, but that's a different topic.
If by "fair" you mean we all pay a roughly equal amount, then I'm cool with that.
If by "fair" you mean that people who are more productive contribute a greater share of that production to the pot to achieve the social justice goals of others, then that's where I think there is room for debate.
I understand the arguments for progressive taxation and I'm not advocating against them, but when you look at taxation in the western world (particularly in the USA) you see a steady rise in use of tax funds to insulate people from negative outcomes that derive primarily from their personal choices.
I'm all for freedom of choice. I'm less for "you pay for my stuff" because I made a choice to pursue a life that doesn't contribute to the general welfare of the country, now or in the future.
I know people will downvote this post, but I know I'm not alone in my thinking.