I was going to make this a comment, but it actually may help provide one possible answer to your question.
The main thing is this - the government can't just "print dollars". Instead, it has to issue marketable (debt) securities, that is, do something like create treasury bills, notes, bonds, etc. and sell them to willing buyers. If the government sells too much debt relative to what buyers are willing to purchase, interest rates will rise. Furthermore, it can't just do this whatever it likes, instead legislation must be passed authorizing the spending, and as seen by the periodic "debt ceiling theater" it has a limit on how much debt it can actually have without passing more legislation just to raise its own credit limit. These "limits" may seem largely symbolic or accounting "tricks", but they do serve as a check on the process.
Debt is not the main way the government gets money, of course. Debt covers deficits in spending, but the majority of the funds the government spends are from taxes. As the U.S. has been running a deficit for a number of years, the current way the government is paying back the money is actually similar to refinancing - taking on new debt to retire the old. People have been prophesying the "end" for at least 20-30 years now, and maybe someday they will be right, but this does not make for a good investment strategy.
Also, another thing to consider is that the U.S. is not the only country with debt. Relative to GDP, the U.S. is around 35th in the world, measuring either by total national debt or external debt, well below other countries such as the U.K. or Japan. As such, it is still possible for the value of the dollar and the economy as a whole to hold up better than expected, simply because it's the best option around compared to the alternatives.