The Colonial Secretary of Belgium said: "During the war, the Congo was able to finance all the expenditure of the Belgian government in London, including the diplomatic service as well as the cost of our armed forces in Europe and Africa, a total of some 40 million pounds. In fact, thanks to the resources of the Congo, the Belgian government in London had not to borrow a shilling or a dollar, and the Belgian gold reserve could be left intact." And in Portugal, Antonio Salazar specifically stated that he would build his nations economy through labor in the colonies. Colonizers themselves were the first to admit how profitable colonialism was, which is why they fought so hard to sustain it.
It wasn’t.
With rare exception, colonies were unprofitable, meaning more was spent building infrastructure like roads, railways, buildings, etc. than was exported.
And look at places like Singapore and Hong Kong. Both were colonies for a long time and yet they are extremely prosperous.