Micheal, think of the country "profit" as a monthly allowance. It does not include many items, such as the purchase of products for your country, including from contracts. If you go to your finance page in detail, check out the "Cash YTD' tab. It will show recent influences of your cash total, and you will notice "profit or loss" is simply one component of this.
It is not uncommon for new players, in particular, to purchase items such as weapons and ammo and assume, since profit is positive, that they are staying in the green. However, the "Cash YTD" tab will include this purchase in the "materials purchased" area, which is indeed separate from the country "profit" consideration.
The three line items that get a lot of work there are the "Materials Purchased", "Spending by the Population", and "Materials sold or used bu Government" areas. A lot can be said of these but, to keep it short, the general idea is that you purchase stuff for your country and much of these things end up being used by the government (which "pays" for it here and "expenses" it in your profit or loss) or gets purchased for population consumption. An earlier writing I did above on this thread talks about the quality to purchase items at, and can do much to make your country run smoothly fiscally in these areas.
If you put effort in, it is even possible to get "deals" on products you know your government or population will eventually need, by finding a cheap market price, and stocking these products ahead of time. Then, if in the following months the market price is higher than what you paid, you either saved money, in the case of government products, by spending less than your profit and loss would suggest or profit by your population paying you more for products than what you purchased them for.