Central banks create money, but governments don't spend that money. They spend money from taxes and bond sales.
About $15T USD exist [0]. $5T are held by foreign banks [1], because the USD is the world's reserve currency. All of those countries want the USD to remain stable, so their own economies can work smoothly. The countries cooperate with USA and side with USA in disputes. This benefits USA greatly. If USA went to the gold standard, this benefit would disappear.
Currencies on a gold standard experience inflation and deflation due to changes in the value of gold. The value of gold is primarily driven by demand for jewelry and manufactured products [2]. Demand fluctuates with the business cycle. Gold value is also affected by supply fluctuations. On a gold standard, these would become extra unwanted currency fluctuations.
Only $9T of gold exists above ground in the world. USA has only 3,000 tons of gold, worth 3,000 t * (1,000,000 g / t) * (oz t / 31.1 g) * (USD$1840 / oz t) = $177B. So to get $15T of gold, USA would need to mine or purchase 250,000 t of gold. This is equivalent to 72 years of the world's current gold production. So to make it possible, gold production would need to increase dramatically. And it would take a while. Meanwhile, the US economy keeps growing, increasing the need for currency.
Gold mining produces huge amounts of crushed ore which continually leaches heavy metal pollution into the environment. Gold mining uses cyanide which occasionally leaks and sterilizes a river or lake and kills all the birds and other wildlife nearby. Increasing gold mining would increase suffering around the world.
Another option is to increase the price of gold. This would negatively affect industry, especially electronics manufacturing. It would also cause an enormous wealth transfer to India and other countries that hold a lot of gold jewelry.
On a gold standard, governments have limited ability to solve problems in money supply, and their currency is subject to business cycle fluctuations and interference from cartels. USA will have difficulty getting enough gold to back its currency. Increased mining will poison people in many communities and devastate parts of nature.
[0] https://www.federalreserve.gov/releases/h6/Current/
[1] https://en.wikipedia.org/wiki/List_of_countries_by_foreign-e...
[2] https://en.wikipedia.org/wiki/Gold#Consumption
[3] https://en.wikipedia.org/wiki/Gold#Production
[4] https://en.wikipedia.org/wiki/List_of_countries_by_gold_prod...