I do have to disagree with some of your determinations though.
Most of the time, the cost of a permit does not come close to covering the cost of the work that goes into the inspection process.
Several small projects, like building a deck, may cost you about $20.00, (depending on the area).
For that you should get a plan review, footing inspection and a final inspection.
That amounts to an office appointment, the staff that does the paper work, and atleast two site visits.
I don't know how much you make an hour but, when you figure out what the time to cost ratio is, you come out way ahead!
I will agree there are some corrupt inspectors out there but, they don't last long because of the politics of the job.
There are crooked politicians, doctors, T. V. repair men/women, stock market brokers, Enron & Tyco heads etc... out their as well as the guy who ran the creamtory with no flames.
But, there are alot of us that go to work to help the area they live in.
You are right about meeting Code does not ensure quality. I try to make sure the home owner gets every dollar he is spending for the job they are doing. If a wall is 4" out of square, they will flunk a framing inspection. (unless the plans called for them to be out of square.)
Every area does things their own way but, if you read the Codes that they have adopted, (if any), almost every situation is covered.
If your area has not adopted any Codes, the State Codes apply.
Sorry for running on but, when I hear the saying, "What's in your wallet", I know it's just my paycheck and maybe my wifes or daughters fingerprints!