The majority of the $13 billion settlement JPMorgan struck with the government Tuesday is likely to be tax deductible, reducing the bank's financial hit.

Here's why: Many of the costs associated with corporate legal cases are treated as deductible under the tax code, in much the same way that a company's wages or equipment expenses are.

That means JPMorgan will be able to reduce its tax bill because of many of the settlement payments that it must make.

"From 1913, our tax laws have permitted companies to deduct their 'ordinary and necessary' expenses, which include compensation and restitution payments," said Steve Rosenthal, a lawyer specializing in financial institution taxation and a visiting fellow at the Tax Policy Center.

But not all types of settlement payments are deductible. For instance, companies are prohibited from deducting fines and penalties payable to the federal government.

"In 1969, Congress decided that allowing companies to deduct fines and similar penalties frustrated public policy, so it disallowed deductions for these payments -- and, separately, disallowed deductions for antitrust damages, illegal bribes, and kickbacks," Rosenthal said.

Related: JPMorgan agrees to $13 billion settlement

The U.S. Department of Justice, which negotiated the deal with JPMorgan, said the bank will pay $2 billion as a "civil penalty" to settle certain legal claims.

And it's JPMorgan's understanding that the $2 billion is not deductible, the bank's chief financial officer said on an analyst call Tuesday.

It wasn't immediately clear how much of the rest of the $13 billion settlement, if any, may be considered non-deductible as well.

But here's the general bottom line: The compensation or restitution portions of a settlement like the one struck by JPMorgan (JPM) may be deducted, but the penalties can't.

While that may seem like a bright line, settlements are often written in a way that can leave a lot open to interpretation.

In some deals, for instance, a penalty may be characterized in such a way that the company could argue that it should be deductible.

That's why some are pushing for much greater transparency in the drafting of government settlements.

Phineas Baxandall, a senior analyst at the U.S. Public Interest Research Group, wants agencies like Justice to expressly label what is "a penalty for tax purposes."

Senators Charles Grassley and Jack Reed recently introduced a bill that would narrow the scope of what can be considered deductible in such a deal.

Under their bill, all settlement payments over potential violations of the law would be considered non-deductible -- unless they meet the criteria of restitution or a payment needed to bring a company into compliance with the law.

The legislation would further require agencies to spell out what is deductible and what is not.

"If a company is paying thousands, millions or even billions in fines, it shouldn't save money for those same misdeeds. It should be held accountable," Reed said in a statement.