The medallion system was a bargain: we protect you from competition, and you agree to price controls and other regulations. Taxis can't do surge pricing, for example, because the rate regulations don't allow it. So if the government is going to back out of its end of the bargain, it's not unreasonable to compensate medallion owners.