Why are there so many people in the US jails?

The US jail population as a proportion of the general national population is the largest in the developed world.

Why?

I can think of a few explanations:

Socialism
US has too little socialism (welfare etc) to keep the underclass (i.e., the people who do not want to work) happy (as opposed to Europe where you can live on welfare your whole life), but it has too much socialism to force such people to really work. Thus we are at a bitter spot (worst case, as opposed to a sweet spot, the best case) on the socialist scale.
Diversity
In more homogeneous societies the share of people whose abilities place them outside the labor force is smaller (you have to know at least some probability and statistics to fully appreciate this theory).
Failure of the legal system
Most people cannot afford an attorney that would stay awake during the whole trial, and without a competent defence attorney a conviction is inevitable.
Failure of the mental health care system
A lot of people in jails should actually be institutionalized.
Draconian sentencing guidelines
US sentencing guidelines are much stricter than in other countries.

Welfare

The welfare system distorts people's decisions in a horrible way: there is a strong disincentive to start working. Quite sensibly, the more a person earns, the less benefits he receives, but early in the curve making the first $100 (or $1,000) can reduce your benefits drastically (specifically, the Medicaid is withdrawn). This means that people on welfare stop to even consider legitimate employment until and unless their benefits are canceled first. This forces some of them into the shadow economy and others into crime (along the usual path: from leisure to drugs to crime).

The Bell Curve

The abilities of a homogeneous group of people are distributed according to the Normal Law (this follows from the Central Limit Theorem) which looks like a bell curve.

The employable population is located close to the center of curve. People far to the left of the distribution are not smart enough to use the increasingly complex technology that pervades the modern industrial society.

A combination of several normal distributions is not normal and may have a higher share of substandard individuals.

You cannot afford to sue anyone worth suing

Lawyers are so expensive that any contest between equals is, essentially, a war of attrition. The contingency system, whereas the attorney is paid from the court award, if any, is good only for high-value cases and is not relevant to criminal cases anyway.

Why don't we just institutionalize these people?

First a joke:

--Why does every university has a Math department?

--Because it is cheaper than institutionalizing all these people!

When I first came to the US (in 1992 to Los Angeles, CA), I was stunned to discover that there are actually some homeless people here in the US! (Soviet media lied so much that I came to presume that they were lying until I got an independent confirmation, so I assumed that since the American homeless were the staple of the Soviet propaganda, they must not exist.) Later I mentioned my surprise to a lawyer friend and he said that the problem of the homeless was, to a large degree, the lawyers' fault: they fought for the Civil Rights of the people forcefully institutionalized and won their freedom only to discover that many newly liberated people were unable to function in the society, so they ended up homeless or jailed.

Tough sentencing

Burglars in the United States serve an average of 16 months in prison, compared with 5 months in Canada and 7 months in England.

The idiotic war on drugs imprisons some non-violent people who should either be hospitalized (if they cannot take care of themselves) or left alone (if they can).

Acknowledgements

Mariana Beytelman suggested the 4th explanation.

Relevant links