Taxis in many cities operate under the authority of a government institution [0], so it makes more sense that they have a duty to do business with the public.
Whereas one can often experience waiting for a Lyft/Uber where drivers repeatedly decline service after initially accepting.
This doesn't really have anything to do with licensing. There are laws that prohibit businesses from e.g. refusing customers on the basis of race or sex and it doesn't matter if you're a restaurant or a hardware store or a flower shop.
Whereas one can often experience waiting for a Lyft/Uber where drivers repeatedly decline service after initially accepting.
[0]: https://en.wikipedia.org/wiki/Taxi_medallion