Why do countries go into debt? Can’t they just print more money?
There's a school of thought in economics that asks this question - Modern Monetary Theory.
@Ahsoka is right in saying that the main danger is inflation, specifically the danger of the money supply significantly exceeding economic output.
It's not a 1:1 relationship though, and many people mistakenly assume that the monetary supply is the primary causal factor for inflation, as well as misunderstanding the ways in which money is "printed" (the vast majority of it is not by central banks/the government).
What matters is how the money is used, which is too complicated a subject to get into, but I did delve into it
in this reddit comment I made. I use very clear language in that post because I am speaking to Redditors who are naturally smooth brained, so it might be a good introduction.
The short of it is:
Modern Money Theory supposes that the increased supply of money can be countered by targeted investment that leads to productive gains, and where an imbalance exists, it can be adjusted for via taxation (as taxation in this model removes money from the supply).
Mainstream economists do not like this view because the equilibrium proposed is not something that naturally occurs - it requires human intervention to maintain. There is considerable doubt as to whether we can realistically be expected to get good outcomes given how fallible our models are. There is also the fact that monetary policy is usually decided by the central bank and fiscal policy by the government, and if these two don't work in concert, the whole thing falls apart.
Monetarists don't like it because it violates their irrational system of nonsense beliefs, but also monetarists and neoliberals monopolise media discussions on economics despite being discredited within the field. So when you hear that such and such country experienced hyperinflation because of its monetary policy, try and consider the source.
The other factor is what Keynes called "animal spirits", and in particular, how most existing economies have entrenched bond markets that are vulnerable to panic. Beyond this: The value of a currency is based on belief, and belief must be maintained. So in other words, if a lot of people don't think an idea will work, it won't work, even if, mathematically, it should work.