There’s a major reason Chicago hasn’t been able to get rid of its street parking privatization deal: because Mayor Rahm Emanuel has fought to keep it in place.

That’s the gist of a ruling Tuesday afternoon by a Cook County judge, who found that the 75-year privatization agreement may be “a bad deal” but can’t be declared illegal as long as the city claims to be benefiting from it.

At issue was a 2009 lawsuit filed by attorney Clint Krislov on behalf of the IVI-IPO, a public-interest group. The suit argued that the deal illegally privatized the government’s right to set parking and traffic policy and restricted the options of future city officials.

But the city teamed with Chicago Parking Meters LLC, the company that controls the parking system, to contest the suit, even after Mayor Emanuel publicly vowed to pursue every avenue he could to get out of the agreement.