They weren't, they were likely invented in Ancient Rome, and soon recognized as harmful, and were illegal until recently, when they got allowed, and again recognized as harmful during the great depression (the Chicago plan that was never implemented).
The problem is that you only see the gains that those who take a loan get, but it only allows them to circumvent the market, and nothing is in fact created, only the resources get misallocated. Somebody else would use what got bought with the money.
Loans existed for at least as long as writing has, and probably for the entirety of humanity’s history. Code of Hammurabi had laws regulating loans, for example.
Why loans result in resources being misallocated? This doesn’t make sense to me. Say, I have some cash I want to save for retirement. Until then, I loan it to other people to run their businesses. Where is misallocation here?
They buy something for the money. That is the misallocation. They couldn't afford it, and your loan allowed it. Let's say they buy a tractor. The tractor would be bought by somebody else. Or perhaps different machinery would be manufactured, or perhaps something completely different would be done, or nothing at all would be done because people would prefer to have more free time. This is how you get massive market imbalances that lead to the great depression, or Evergrande.
No money is known that was used before classical antiquity, it must be a mistranslation.
Someone buying a tractor on a loan doesn’t take away someone else’s ability to buy a tractor. We have no shortage of tractors. Practically all new tractors today are bought on a loan, by the way.
Imagine what would happen if loans on tractors would not be allowed. Then, someone who needs a tractor would need to rent it, instead of buying it. In that world, pretty much the same people who use tractors now would also use tractors. Tractors use would be similarly allocated as today. The main difference is that instead of a bank earning income by renting you money, it would earn income by renting you tractors. The ultimate outcome would be effectively the same.
Loans is just renting, but instead of renting physical objects, you rent money. If you object to renting money, all your objections should apply to renting physical things. Have you thought of that?
Money isn't a resource that is objectively needed, its role is to regulate economy. You could do anything that you do just as well without it, if people could agree on it. It isn't like a tractor that is needed, and there is no problem with renting tractors. The problem is that you do use money in your example: you use it to store your savings. By lending it,it gets used twice - once to buy the tractor, the second time it's still used to store your savings.
It does take away somebody's ability to buy a tractor, as you buy one, so there is one less, or one extra needs to be manufactured. That can also be a problem - too many tractors can be created, so that food gets so cheap that it's basically free,and the farmers now can't make money. Which is what literally happened in the great deoression.