As decided by the people. They could have politically campaigned to change that, buy out all the medallions at fair market price and the redistribute them for free in sufficient quantity.
Fuck that. Medallions are licenses and the government can grant more licenses as they see fit. They don’t need to compensate people who already hold them for granting more.