Dan Davies recently pointed to one of Wall Street’s little secrets that I’m all too familiar with: that banking “has suffered from decades of underinvestment in technology.”

In response to Davies’ article, James Kwak keyed in to one of the reasons why that’s the case: while traders have an incentive to invest in technology that enables them to “parse information faster,” when it comes to risk monitoring, underinvestment is a feature, not a bug.

Kwak writes about the twisted incentives that lead to bad risk management systems:

Risk management systems don’t generate profits; they are part of the back office that banks wish they didn’t have to have. More specifically, traders have no interest in effective risk management systems.

But risk management systems aren’t the only place where a deliberate under investment in technology has occurred on Wall Street. Banks have also failed to build good technology to service mortgages. And they have been rewarded for that failure with profits.

In case you need a refresher: the servicer of a mortgage collects monthly mortgage payments on behalf of investors, and they’re responsible for modifying the loan if the homeowner has trouble making their payments.

But there’s a problem: servicers’ incentives often conflict with those of other parties in the transaction, as noted by Adam Levitin and Tara Twomey in a 2011 paper :

Servicers have no stake in the performance of mortgage loans, so they do not share investors’ interest in maximizing the net present value of the loan. Instead, servicers’ decision of whether to foreclose or modify a loan is based on their own cost and income structure, which is skewed toward foreclosure.

And beyond not having interests aligned with investors, servicers likewise have no real incentive to serve borrowers, either, since customers have no ability to pick and choose the company that services their mortgage.

So with no real customer that has the ability to “fire” them for poor performance, it should come as no surprise that the Consumer Financial Protection Bureau found in 2011 that the largest mortgage servicers saved more than $25 billion by under investing in servicing systems and procedures.

And as the foreclosure crisis crept on, banks didn’t really improve their servicing systems in a manner commensurate with the scale of the problem.

In 2013, an investigative series on Naked Capitalism provided a peek into just how bad these systems were. Naked Capitalism interviewed five contractors who had worked on Bank of America’s foreclosure review, as a part of the Fed and OCC-initiated Independent Foreclosure Review (IFR). (The IFR was meant to compensate homeowners for improper and illegal foreclosure practices. Instead, it became a massive cover-up for bad bank behavior).

According to the contractors Naked Capitalism interviewed, reviewing just a single Bank of America mortgage loan meant accessing between seven to ten different systems.

A sample DOS prompt.

In addition, Bank of America’s old mortgage system, MSP, outputted pdf images of documents from “a DOS-prompt system.” That’s right, DOS! Technology that was cutting edge…back in 1981.

Crappy risk management technology enables traders to make big bets and not trigger alarms. But banks also have a perverse incentive to keep servicing systems bad: after all, what better way to cover up illegal foreclosures than to bury loan details inside multiple, terrible technology platforms?

In the end, to solve this problem, servicers’ incentives need to be aligned with those of investors and homeowners, who both have an interest in keeping borrowers in their homes. That means changing servicer compensation structures so they get paid when banks invest in good tech and sustainable loan modifications happen, rather than when borrowers are milked for fees and then ultimately foreclosed upon. With the government insuring or guaranteeing the lions share of today’s mortgages, federal regulators have the power to lead the way. Now, if they’d only act.