I'll tell you why. These settlements are probably large to huge in size right? Well, all of your empires costs are split up by settlement size, so those that have large populations end up paying a huge cost of the military upkeep, which outweighs what you earn. You do still earn money from your farming, trade and mining, but with such a large military, the wages have to be paid from somewhere, and it makes sense for it to come from large settlements!