Cab drivers rent those medallions for around $200 per day, and after paying off the investor, kept any profit on top of that. On a bad day, they'd lose money. On a decent day, they'd work a 16 hour shift and make minimum wage. On a great day, they'd make a few hundred bucks.
In Massachusetts, the law is designed to protect those investors (who lobbied for it) -- not cab drivers. There is nothing in the law which is not corrupt.
Self-driving cars will cost jobs. This just costs the very rich their investments in medallions, which prior to Uber were a full-proof investment.