Governments frequently consume more resources than they can purchase with the taxes they collect.
Yes, they could just print all the money they could ever need. And when they do, inflation runs wild. Then a government cannot borrow in its own currency because no one will trust it. Or it must pay a high rate.
The US government is in a unique situation. It's been able to print much more than a government normally could because it is the most trusted reserve currency in a rapidly globalizing world. Trillions of dollars are held overseas. And if the dollar loses that role, you will see a lot of inflation as those dollars return to the US. Even if it doesn't lose that role and the world just stops taking additional dollars, the US would have to print less to keep the same rate of inflation.
Most governments don't fall into this category. And no country is in this category forever.
A country's currency is really just another form of debt. And while it may never run out, the more it prints, the more it declines in value. It's not debt people can collect on, but the law of supply and demand will certainly collect on this debt.
And it's also a tax, a tax on savings. And the country could remove dollars from circulation, thereby reducing this debt and reversing the decline in the value of savings.