Actually it wasn’t. The national debt had been falling for a few years when Nixon took the US off the gold standard. This was even discussed on HN in the past few days.
By that time, gold redemptions were mainly available only to foreign entities. Unlike all other forms of money[1], only US federal government spending, in cooperation with the Fed, could create new reserves[2]. That there were too many reserves in foreign hands chasing $35 an ounce gold could only be the result of US federal spending. Therefore while foreign demand was the proximate cause, it was definitely a downstream consequence.
The size of the US government's outstanding liabilities at the time isn't relevant, what affects prices is money flows, not stocks.