As others have noted, you need to look at per-capita effects of spending. Maintaining a constant defence budget while the population of the defended increases probably doesn’t have any per-capita effect. Maintaining retirement or health care spending while the population both increases and becomes older means that you’re reducing per-capita spending while also delivering less benefits to the recipients than their predecessors. (In other words, even if the overall US population was not increasing, but the percentage of elderly was growing, maintaining constant individual retirement and health benefits would mean that total costs would still rise.) Other government spending programs will have mixed per-capita requirements. It takes more resources to manage a population of 330 million than 300 million. You may not need 10% more roads, but if traffic increases by 10%, you probably want to increase your road maintenance budget and the number of buses.
Another factor is that government spending is part of the economy. You can’t assume that economic growth would be the same whether the government spent $3.6 trillion or $4.8 trillion. The cost effect is obvious, but that extra $1.2 trillion in spending provides economic stimulus that does drive the revenue side of the budget. Some of that spending should be considered investment, where the long term benefits exceed the near term costs.
Interest rates also need to included in your model and not just inflation. Right now, debt is cheap because interest rates are so low. Even so, the US government expects to spend $378 billion on interest payments in 2020. U.S. Federal Budget Breakdown If interest rates go up, overall spending will go up even if all other spending levels are maintained or reduced. Some economists would actually like interest rates to go up, as the economy has been doing well for a long time and lowering interest rates are one of the easy way of stimulating the economy when it takes a downturn. Right now, the US only has a limited ability to take that action.
A fourth factor is that governments like to spend money to get the economy out of trouble, but also like to spend money, or reduce taxes, when they have a surplus. Over the long term, a steady tax and spend policy would be level across the booms and busts of the economy. However governments aren’t very good about saving for a rainy day, whether it’s in terms of keeping the proceeds from the good times (or more realistically paying down debt), or pursuing more constrained fiscal policies.
Having said that, your basic idea is correct. Over the long term, per capita tax revenues should rise as technological improvements lead to increased productivity which leads to economic growth, so long as tax policy remains consistent. If per capita spending increases at a slower rate than revenues, eventually the US budget deficit, and then more eventually the US national debt, will be eliminated. But it will take a long time and steady, stable fiscal policy. Given the current picture of US federal politics, I think you may have to wait a few years for that.