Its because the result of buying from a terrible baker is I might get food poisoning. On the other hand, a terrible taxi driver could very easily get me killed.
The regulations in place don't do a huge amount to fix either of those problems, but having something in place makes people feel better.