Nordic countries have low crime rates to begin with, which allow them to build relatively spacious prisons and allocate more treatment resources per prisoner.
It’s a bit of a chicken and egg problem we’ve got. We could just not prosecute many non-violent crimes, like our District Attorney chose to do in San Francisco. But that didn’t pan out well and we now have the highest non-violent crime rate of any major US city.