Barclays disgraced itself in many ways during the pre-financial crisis boom years. So it is tempting to think the bank, when asked by US Department of Justice to pay a large bill for polluting the financial system with mortgage junk between 2005 and 2007, should cough up, apologise and learn some humility.

That is not the view of the chief executive, Jes Staley. Barclays thinks the DoJ’s claims are “disconnected from the facts” and that it has “an obligation to our shareholders, customers, clients and employees to defend ourselves against unreasonable allegations and demands.”

US justice department accuses Barclays over mortgage mis-selling Read more

The stance is possibly foolhardy, since going into open legal battle with the most powerful US prosecutor is risky, especially if you end up losing. But actually, some grudging respect for Staley and Barclays is in order.

The US system for dishing out fines to errant banks for their mortgage sins has come to resemble a casino. The approach prefers settlements behind closed doors and the difference in size of penalties is never explained. Occasional leaks of the negotiating demands make the methodology appear even more arbitrary. Deutsche Bank was initially asked for $14bn (£11.5bn), but reached a settlement of $7.2bn on Thursday. Where is the rhyme or reason?

There is also a strong suspicion that the roulette wheel is weighted against the Europeans. US banks, in the forms of JP Morgan, Goldman Sachs, Morgan Stanley, Bank of America and Citi, were at the front of the queue for settlement for no obvious reason. If Barclays created and distributed far fewer toxic mortgage securities than its US rivals, which is what the bank argues, why shouldn’t its fine be proportionately smaller?

Neither Barclays nor the DoJ is talking hard numbers. But Barclays, it is said, was asked for $4bn, versus its own analysis that a fair sum would be $1bn and $2bn could have been swallowed for the sake of certainty. When the gap is so wide, Barclays is entitled to take its chances in court – and yes, it probably has an obligation to do so. A board can’t let $2bn slip out of the door just for the sake of a quiet life.

The case will be messy, inevitably. Barclays’ practices were “plainly irresponsible and dishonest,” according to Loretta Lynch, the US attorney general. There is also a cache of ugly emails and documents. The DoJ lawsuit says Barclays employees called one parcel of securitised loans “craptacular”. Another was said to “look like shit”. However, that is almost par for the course in these cases.

The central question is the right size of penalty. If Barclays thinks it has been singled out for unduly harsh treatment, the bank should try to prove its case. Staley will look like a fool if he fails, but the willingness to reject the easy option of settling is entirely legitimate.