Like any business, war requires an investment. Then once you conquer a country, you get a good return on investment.
A country has plenty of assets to pillage. You can take its cash, weapons, and a controlling interest in any interesting public country corps. You can sell the weapons for a tidy profit.
Sometimes the investment funds of a conquered country have interesting shares you can buy. You can sell its production plants to your main country, then transfer that cash (maybe 50 billion) to your main country.
You can do worker exchanges to get the workers you need the most. If you get a lot of engineers, your main country can specialize in high tech industries. Engineers pay a huge amount in income taxes.
After pillaging, you can cancel the country, preferably before its reconstruction starts becoming expensive. The return on investment is roughly 1 trillion from pillaging a c3.
Of course, its best to minimize costs by fighting the cheapest wars.