But the social purpose of loans is to help people who have an urgent need, or an unexpected one.
Living beyond your means isn't inherently part of borrowing money.
If you can't get a loan to buy a house, having to save for 30 years is in some sense, making you a lot poorer. You only have so long to live, and for 30 years, you don't get to live in the house.
And if you can't get a loan when something unexpected happens, then bad things could happen, that are really unnecessary. People don't have to prepare independently for all possible disasters because we live in a society.
If you think borrowing money is bad, what about borrowing things? Should rental cars be eliminated? Is it only that borrowing things should be free? Is borrowing a cup of sugar from your neighbor ok?
Edit: I should say, urgent, unexpected, or short term.