In accounting, income and expenses can either be current or capital.
Current income or expenses are those which repeat periodically. For example: dividends and interests, rent and salaries.
In the game, an example of current expenses are the salaries you pay to your health staff, and as an example of current income there's the tax collected from corporations.
Capital income or expenses are those which occur only punctually - the purchase of an estate in Estoril or winning the lottery.
In the game, purchasing schools, hospitals, or, in this case, weapons are treated as capital expenses. If someone buys one of your corporations, we are talking about capital income.
To put it in a simple (but wrong) manner:
Current expenses/income are those which are expected; capital expenses/income are those which aren't.
What you are seeing is the difference between current expenses (maintenance of the army) and capital expenses (purchase of ammunition or weapons). The game is classifying and calculating things correctly. You are spending 179B yearly(?) on defense, and you spent 2.02T in weapons and ammunition this current year.
I suggest that you halt your purchases (manual and auto orderings), to stop this. If you aren't ordering manually, review your auto orders. The weapons could be going into your garrisons.
Reach level two first, though, for the Gold Coins, if you already haven't.
I do know your country is buying weapons, from looking at your graphs.
Also, if your country/empire is profitable, debt doesn't matter much.