California is a bad example. There is still a cost to the business (machine maintenance, electricity, water) for which they must now bear the burden.
Any consumables a shop uses to fix your vehicle (not tools) is a legitimate charge to the consumer. Shops pay a cheaper price than retail for parts. After a shop marks the part up, it may end up being more than retail. Shops are in business to make money. They should make a profit in most everything they do. You would. Marking up a part not only allows them to pay their expenses (rent, utilities, mechanics, service writers, shuttle service etc) but it also allows them to cover partial expenses for labor claims (ie. part failures.)
The labor rate pays the mechanic and shop depending on pay schemes. The book value is based on morons like us doing the work. So if book value is 2hrs., that's what they charge in labor hours. Good mechanics will complete the job in less time, perhaps 45 mins to an hour. Doing so, the shop could be profitable. Some jobs though, may have issues which turn a 2 hr. book value into 6 hrs., you still get the 2.
Of course, some shops allow you to bring parts in yourself, but won't cover parts or labor if there is a problem.