To understand why we have a student loan crisis — and with $1.6 trillion in outstanding student debt, it surely is a crisis — just look at the U.S. bankruptcy code.

In 1965, Congress passed the Higher Education Act, part of President Lyndon Johnson's Great Society. On the one hand, the new law established federal grants and loan programs to ease the monetary burden of attending college, especially for disadvantaged students. On the other hand, the bill included rules that made it difficult to discharge a federal student loan in bankruptcy.

Over the next four decades, Congress added additional restrictions that made it not just difficult but impossible to shed a federal student loan, no matter how dire a borrower's circumstances. In 2005, Congress crossed the final frontier: It added privately issued student debt to its no-discharge list.

We've all heard the horror stories that ensued. Students enrolled in for-profit colleges only to discover their "diplomas" didn't get them the job they had been led to expect — leaving them only with an impossible debt overhang. Former students defaulted — only to have their wages garnisheed by the federal government, which was as ruthless as any collection agency. Loan servicers found reasons to pile on additional fees and charges.

Nearly one out of five former students is in default, according to the Pew Research Center. The student loan burden has been debilitating for millions of people who hoped that taking on that debt would lead to a better life only to discover that, for one reason or another, it didn't.

But there is another largely unacknowledged consequence of outlawing the discharge of student loans in bankruptcy: It ushered in a lot of "moral hazard."

Remember the subprime housing bubble? When brokers sold homes to anyone with a pulse, knowing their firms would offload the loans to Wall Street, so they didn't care whether the borrowers would ever repay the money? The student loan industry is built on a similar premise.

The federal government gives student loans to just about anyone who asks, regardless of income or ability to repay, knowing the borrower can't ever elude the debt. The same is true of private lenders.

Universities raise the price of tuition with impunity year after year, knowing that loans will always absorb the increases. For-profit colleges wouldn't exist if students could discharge their loans in bankruptcy; their entire business model is predicated on being paid up front by the federal government — which then becomes the entity that has to worry about being repaid.

With student loans a risk-free bonanza for lenders and universities, is it any wonder that student debt has become the second-largest form of consumer debt in the U.S., trailing only mortgages?

As a general proposition, I'm sympathetic to those calling on President-elect Joe Biden to erase some of that debt once he takes office. According to Sen. Elizabeth Warren, 42 million Americans have student loans; she has filed a bill to cancel $50,000 of that debt for each of them. That legislation has gained favor among progressives, who are pressing Biden to take action through executive order as soon as he is sworn in. (Biden has floated a more modest $10,000 relief plan through legislation.)

The rationale isn't just to help former students unable to pay back their loans but to help the economy. Student debt is preventing many millennials from buying their first home; between 2005 and 2015, homeownership among people ages 25 to 34 dropped by 10 percentage points. It is making it impossible for former students to start small businesses or take jobs that don't pay a lot of money. It makes it harder to get credit to buy other things. In other words, it holds back millions of young Americans from participating fully in economic life, which has a ripple effect across the entire economy. Canceling student debt would act as much needed economic stimulus.

But I also understand the resistance to loan forgiveness, especially among conservatives. It wouldn't be fair to the millions of Americans who did pay off their student loans, often after years of financial struggle, they argue. It would help "high-income professionals with graduate degrees" more than low-income former students, as my Bloomberg Opinion colleague Michael R. Strain pointed out recently. And as much as relief might bolster the economy, it would be enormously divisive when the incoming president is trying to unite Democrats and Republicans.

Which brings me back to bankruptcy. Passing a law that allows student loans to be included in a bankruptcy filing is the obvious compromise. It doesn't give either side everything it wants, but it gives each of them enough to make it an acceptable solution.

For those advocating canceling student debt, changing the bankruptcy law would do just that. Former students wouldn't be able to discharge only $10,000 or $50,000 but their entire debt load. Because the federal government owns more than 90% of student loans, it would absorb the vast majority of the loss. The government might also need to cover the losses for the debt that isn't federally guaranteed because private institutions made the loans before the change in the law.

For those opposed to canceling the debt, there would be some comfort in knowing that bankruptcy comes at a price. It would be a part of a borrower's credit report for seven or 10 years, depending on whether Chapter 7 or Chapter 13 is used. The availability of credit would be sharply diminished during those periods, eliminating the ability to obtain a mortgage and other loans.

The best part is that when incoming students wanted loans, the bank or the government would have to do some true underwriting. In many cases, parents would have to co-sign, which would limit the size of the loan to their ability to repay. Universities would have to think twice before raising tuition because loans wouldn't necessarily cover the increase anymore. The business model of for-profit colleges might well be irreparably harmed — which would be a good thing, given that too many of them seemed like scams.

The key point is that 18-year-olds with big dreams would no longer be the ones deciding whether they could repay $100,000 or more in student loans. The lender would have to be responsible as well.

To those who would argue that this plan would make it nearly impossible for working class and poor students to obtain student loans, the answer is: You're right. But there is a solution to that problem as well.

The government has long had repayment plans based on income. The idea is that after graduating, the former student pays a percentage of income (usually 10%) for a fixed period of time (usually 10 years). The problem with these plans is that they are absurdly difficult to get into and just as difficult to stay in because they require reapplying every year. Making it simple to enroll in these programs should be a Biden administration priority.

After that, a Biden student-loan program could give students a choice: They could either agree to pay back the loans or agree to turn over a portion of their post-graduation income over 10 or 15 years to the government in lieu of full repayment. For certain kinds of public-service jobs, the percentage of income could be reduced.

There are many other possible variations that would make income-based repayment plans desirable. In the worst-case scenarios for borrowers who couldn't repay, bankruptcy would still be an option.

The original impulse of the 1965 Higher Education Act was noble — to make it possible for millions of Americans who couldn't afford college to nonetheless get a college degree. Today, making it possible for students to get that degree without a crushing burden of debt is just as noble. Bankruptcy is one way to help get there.