Infinite free money hacks is literally how fiat currencies work.
The government wants the economy to operate at close to full capacity, so it creates money and spends it into the private sector.
Eventually that money makes it to individuals, who want to save some of that money. There’s also foreign agents that might want to hold on to your currency, and trade happening that means some of your money leaves your country.
If the government maintains steady spending, this money supply slowly dwindles, which leads to a shrinking economy.
So governments issue debt to offset that dwindling money supply. The catch is that spending that doesn’t create real resources is inflationary, so you have to spend money on things that eventually earn you more money.
At the end of the day, that’s the idea of macro economics. Spend enough to get your economy growing, while making sure inflation doesn’t go up too much. Which is why people that complain about debt have no idea what they’re talking about.