On one level it sounds so simple.

People should get the same pay for work of similar value regardless of gender. The Treaty of Rome said so way back in 1957. The UK law enshrined it when the Equal Pay Act came fully into force in 1975. What could go wrong?

Pretty well every thing as it happens. From dodgy employers in the early days who thought it smart practice to promote every single bloke on the payroll, to mass re-writing of job descriptions, to assembly lines being re-jigged to make them single sex.

And even when the rogues were rounded up, the earnings gap stubbornly persisted. Still does. But now all these years of underpayment have come back to bite cash-strapped local authorities who, not exactly obstructed by male-dominated unions, continued to preside over arrangements which turned out to be institutionally discriminatory.

A landmark judgment at the end of last year found Birmingham City Council on the wrong end of a court case brought by more than 170 women claiming back pay over six years. It is likely to open the floodgates for hundreds, if not thousands more.

Meanwhile, next month sees Glasgow City Council at a second session of an employment tribunal – there's a third scheduled for May – defending the arrangements it has come to after a process which began way back in 2005. A process which has already cost it over £50 million in compensation packages to female employees.

But this is not a straightforward tale of winners and losers, nor for that matter heroes and villains. When Glasgow City Council did its job evaluation exercise seven years ago there was no shortage of pay anomalies tumbling out of the woodwork.

As was the case with other councils, pay rates had grown up which made the casual assumption that outdoor dirty jobs like refuse collection and grave digging were intrinsically worth more than indoor manual work like cooking and cleaning. No prizes for guessing which of these categories employed more men than women and vice versa.

On top of that was an extraordinary bonus culture which widened the pay gap quite dramatically. As one executive explained "it seems that in some areas bonuses were being paid for turning up to work". And a lack of transparency around who got paid what and why meant that many of the disadvantaged women had no notion just how poorly paid they were by comparison with similar or poorer male skill levels.

The workforce pay and benefit review was designed to examine and eradicate these anomalies. Glasgow decided not to use the Scottish Joint Council Scheme still under negotiation, but used the Greater London Provincial Model on the grounds it would be a faster option than re-inventing the wheel. This entailed putting diverse jobs into 13 "job families" depending on the working context and skills.

The exercise meant higher pay for almost 25,000 employees, but loss of earnings for just under 4000. Under the deal anyone losing more than £500 would be offered skills development and there would be pay protection for three years.

The unions had several complaints about this, suggesting – among other complaints – that employees having to sign on the dotted line before being compensated for previous inequities was a form of blackmail.

But their cages were also being rattled by a new breed of specialist lawyers who saw the fight for equal pay as a lucrative niche market.

Their pitch was that on a no-win-no-fee basis they could get the women a better deal than union reps who, they suggested, had been asleep on the job in order to protect the incomes of their male membership.

Since the lawyers' cut of a successful action involved anything from 10% to 25% of the women's compensation packages, it seems somewhat disingenuous to suppose the main motive was a lofty crusade against injustice and discrimination. The unions, however dozy, went into bat for nothing.

In the event, four times as many Glasgow employees plumped for a private law firm than for Unison, though not the least of the ironies in this saga is that many of the lawyers involved had previously worked for Unison.

But, as I said, this is not a simple tale. Righting previous wrongs is important. Equal pay for work of equal value is essential. Yet all of this unfolds against a backdrop of budget cuts inevitably resulting in job losses.

It's not so much being careful what we wish for, more a dispiriting calculation on benefits versus costs.