The short answer is it's not illegal because the laws don't prohibit it. The laws don't prohibit it because it's in the best interests of the people in power to allow fractional reserve banking.
Fractional reserve banking allows for more currency to be in circulation than actually exists. The government doesn't have to directly inflate the currency by printing more of it, they just let the banks loan more than they have in deposits. This effectively creates more currency. Somewhere around 90-95% of the currency in circulation today is created by the banking system through fractional reserve lending.
Prices always rise to soak up the extra currency though, so fractional reserve banking leads to inflation and higher prices. In the short-term is can provide a boost for the economy since more people will have access to the money and GDP will increase as the velocity of the currency increases. However, over time, the markets will adjust to the more readily-available currency and prices will rise.
The danger is that not only does it lead to inflation, it also means there isn't enough currency to go around if something goes wrong. If even a small fraction of people decide they want their deposits back, the system is in trouble. Most people leave their currency on deposit, so if even a small percentage of the currency is called upon, there could be a run on the bank.
Additionally, when you have a fiat currency and fractional reserve lending, the currency isn't backed by anything other than faith in the government. This can cause even more issues for the economy because once public sentiment changes to believe that the currency doesn't have value, people rush to get their deposits back so they can buy things of value before the currency hyper-inflates.
It's all interconnected and it's all bad news in the long-term. Short-term it can lead to booms, but eventually there will be times of bust as the market resets. Remember though, those in power want to stay in power, so as long as they can stay in power by using tools like fractional reserve lending, they will.
tl;dr It's not illegal because it helps the people in power to stay in power.
It's a very good question. It started out many many centuries ago when some goldsmiths who specialized in holding gold on their customers' behalf noticed that it almost never occurs that all customers come to get their gold at the same time. They started to give deposit certificates in excess of the actual gold they had in their vaults. This increased the money supply and benefited the economy in some ways but created the risk of a bank run.
Fractional reserve banking combined with the gold standard isn't fundamentally any different from what Tether is accused of doing: printing USDT out of thin air as in not having enough cash in the bank to back up each USDT issued. Nowadays when the gold standard has been given up for, fiat money has no backing whatsoever except its status as legal tender which means, among other things, that the government demands all taxes to be paid in it, which guarantees a certain level of demand for it.
The laws allow banks to issue loans up to a certain multiple over their reserves even if they don't have the money at hand. Banks make money from loans and the interest on that is the profit. A bank has to have a reserve in case anything goes wrong but the law allows them to loan more than they actually have. If everything came crashing down there would be problems.