Because they can.
The dollar is currently worth less than 1% of what is was in 1913. The only explanation for a sustained general rise in prices is an increase in the money supply, beyond the increase in the production of goods and services. (The quantity theory of money).
Any money supply is optimal. Prices will adjust accordingly. If the supply of gold becomes lower relative to the supply of goods and services generally, then prices will go down, increasing the purchasing power of anyone holding money. Demand for gold will then increase, making gold production become more profitable, stimulating an increase in gold production.
Had we not abandoned the gold standard, the production of gold would have kept pace with the production of goods and services generally, because on the market, there is a strong tendancy for the rate of profit to equalize among all industries, including the prodcution of gold.
If gold ever became too scarce to satisfy the demand for it, people would seek substitutes, as they do with any other commodity. There is nothing wrong with this. Precious metals are the correct money, not because I say so, but because the market says so. The world gold standard evolved sponaneously over countless centuries. The switch to paper fiat money was forced upon people by those with the power to do so.
The overall economy cannot be made richer simply by creating more money. If it could, we could not explain why there is even a single poor country anywhere, for all any country would need to do is print more money, and become rich.
To debunk your confusion, listen to the second mp3 below, Rothbard. The chapter is called "The decline from weight to name". He clearly explains the fallacy present in your notion that there is "only 164 billion dollars worth of gold".
Competition is good, monopolies are bad.
Listen to Rothbard on the subject.
http://www.mises.org/multimedia/mp3/audiobooks/rothbard/money/5.mp3
http://www.mises.org/multimedia/mp3/audiobooks/rothbard/money/6.mp3