I don't really get it. If every dollar in existence has to be backed by gold, then banks wouldn't be able to loan money from deposits.
No, they could.
A dollar backed by gold does not have to be kept at the bank. It would almost certainly be kept somewhere else. Rather, every dollar in circulation could be redeemed at a Federal Reserve bank for a set amount of gold, at least in theory anyways. People could still deposit their dollar bills at the bank. However, what couldn't happen is banks couldn't create credit out of thin air, as they do right now.
The problem, to which you are alluding, is that if the money supply is fixed, then such a system would be a constraint on growth. In the normal course of business, demand for money grows as the economy grows. The cost of money is the rate of interest. If the economy grows and the amount of currency stays constant, then interest rates will rise higher than necessary, which would lower economic growth and the economy will grow slower than it would if the rate of money growth were the same as the growth rate of the economy. This is the knock against the gold system. The supply of money should grow at the same rate as the growth of the economy.
In the gold system, since gold is money, when the cost of money rises, then so will the price of gold. The proponents of the gold system argue that if the price of gold rises, that will induce miners to increase their production of gold, increasing supply. Since the supply of gold would increase, so would the amount of money, decreasing interest rates and increasing economic growth until the economy was back into equilibrium.
This may be true over the very long run, but the problem with this argument is that it assumes that the costs of getting gold out of the ground is constant. This isn't the case. For a real world example, over the past 10 years, the amount of gold being brought to market by mining companies has actually fallen, even though the price of gold has risen from $300 to $1200.
On the other hand, the Tea Party people have a point. The unhinging of the dollar from any anchor has allowed the creation of credit and money to explode over the past four decades, in particular, the past decade. The primary cause of the financial crisis IMHO is the Fed. Next was Wall Street. Both were responsible for the excess creation of money. And with all the cheap money floating around the world, and the massive deficits being run by government, fiat money is just going to fall even further against gold and other real assets.