Contract enforcement is only part of the issue.
The main issue is that cab-like services are usually regulated in such a way to act like an extension of a city's other transportation services like buses, trains, etc..all of which is basically considered infrastructure. Just like power lines, roads, and anything else that is best maintained by enforcing artificial monopolies at some level, with that level usually dictated by natural limitations. Like... only room for one road here, it makes sense to only allow one entity to control road creation.
Same goes with Taxi-like companies. There is basically a limited amount of $ to be made, with the most profitable areas being downtown, runs to the airport, etc.. certain areas only. Most cities say to taxi companies, "in exchange for having a license to operate in our city, you must promise to not discriminate based on race/religion, etc.., and you must service the less profitable areas equally as well as the more profitable areas".
If some service comes in and competes with Taxi's, but only has to compete in the profitable areas, the taxi service will go bankrupt. Now the city has no transportation service to offer anyone in the less profitable 'outlier' regions around the city. Unless they want to extend rail lines and buses, which may not be economically feasible if the traffic density is low.