As I constantly and tiresomely reiterate, academic writing tends toward sophistry, superficiality, and obscurantism. Personally, my aesthetic tastes are offended by the endless rivers of overabundant verbiage one has to wade through in scholarly articles and books. But leave that aside. It sometimes seems as if most writers specialize in missing the point. Consider the typical arguments of liberal and conservative anti-colonialists (or so they characterize themselves) who want to defend capitalism against the charge that it necessitated or directly caused the brutal imperialism and colonialism of the 19th and 20th centuries. There are various arguments you can expect to find in their writings. They'll say that colonialism (e.g., the Scramble for Africa) was financially and economically senseless, since (supposedly) it led to the home country's net loss of income and resources as it built up infrastructure in the colonies. Some money and resources flowed home, but even more flowed abroad. Or they'll say it wasn't primarily economic motives that led to colonialism but rather forces like popular nationalism, the vainglorious egos of politicians, irrational racial ideologies, the political power of the military and diplomatic corps, and so on. Strictly speaking, all this colonialism was unnecessary, in fact a terrible and bloody mistake.
So don't blame capitalism for it! Blame those stupid irrational Europeans of a hundred years ago!
The historian Jonathan Daly, a great enthusiast of "free-market capitalism," is, like his more well-known but utterly absurd and embarrassingly vulgar University of Illinois colleague Deirdre McCloskey, one of these writers. Let's take a look at his textbook The Rise of Western Power:
...Economics, far from the main driving force, was often only an ex post facto argument for retaining colonies. Yet colonies almost never paid for themselves, enriching only some individuals or companies, and did not magically enable merchants to gain access to commodities they could not have otherwise acquired through open trading...
...[T]he intense worldwide struggle for colonies was not even a boon to the competitors. Was there a deeper reason [than economics] for the New Imperialism [of the late 19th century]? The West’s raw physical power, apparent scientific mastery of nature, efficient and dynamic economy, and myriad technological advantages provoked a broader moral crisis of Western civilization involving aggressive ideologies justifying and lauding violence and struggle as central to human existence. Sigmund Freud, shocked by the carnage of World War I, hypothesized about the “collective insanity” of Europe. It does indeed seem as if some kind of psychosis drove the European peoples to imperialism and war at the turn of the century.
Some kind of psychosis. What a profound explanation. [Daly is a great guy, but I disagree with his approach to history.]
In response to such arguments, I'd say, first, that whatever the economic benefits to Europe at the time were or weren't, in the long run the colonization of Africa and Asia was enormously beneficial to industrial capitalism and world economic growth. Intervention in these regions on a colossal and brutal scale was necessary in order to thoroughly integrate them into a capitalist world-system. You have to create labor markets there, uproot traditional social structures, dispossess peasants of their lands, implant modern technologies and administrative controls, remake the whole society. Once you've accomplished that, after many decades, you can let the re-socialized natives take political control again and run the new system for the benefit of international capital, as has happened to a greater or lesser degree since the 1960s. That is, once you've created new structures of internal political and economic control, you can put your past and present victims in charge of those structures and rely, most of the time, on less direct means of external control ("neocolonialism") to make sure the newly "independent" societies stay in line.
Aside from the incomparable benefits to future capital of the brutal restructuring of Africa, Asia, and South America (not always in the same directly "colonial" way—the process of revolutionizing traditional societies can take more than one form), such restructuring was inevitable anyway. Not even liberal and conservative hacks can realistically deny that capitalism is an intrinsically expansionist, dynamic, growing system, a system that entails perpetual growth—the hunt for and cultivation of new markets, new raw materials, new opportunities for investment. This process necessarily continues until the whole world has been transformed in the image of capitalist relations of production, as it finally pretty much has by the 21st century. As industry and investors extended their tentacles to "peripheral" regions of the world in the late 19th century, it isn't exactly accidental or mistaken that governments were prevailed upon to protect investments and facilitate the whole process legally, financially, militarily, administratively, and technologically.
So, in effect, we've already dispatched the arguments of capitalist apologists. It didn't require a long academic article or book, only the application of some historical common sense. Imperialism and colonialism were a natural and inevitable product of capitalism, and in the long run (arguably also in the short run) they very much benefited the countries that undertook them, enabling further economic growth, world trade, international investment, the accumulation of profits and resources, etc. Societies had to be remade in the image of capitalism, and this process was never going to be peaceful or "free."
But more can be said. Did colonialism really, in most cases, not economically benefit the home country in the short term? Was it really economically irrational? We can concede that it was to the far greater advantage of investors, politically connected industrialists, and arms manufacturers, not to mention the military and diplomatic establishment, than of the general population. It may, in fact, have slightly harmed the latter in some cases, inasmuch as a portion of their taxes went to pay the costs of having a colony. But this argument is of no help to the defender of capitalism, because it's an inevitable result of the ongoing accumulation of capital that some people and businesses will become far more wealthy than others, and that their wealth will confer political power, with which (frequently) to manipulate government towards a militaristic, imperialistic foreign policy. So even if colonialism wasn't of much immediate benefit to the countries that embarked on it but primarily only to favored investors and the upper class, that doesn't get capitalism off the hook, for capitalism creates the circumstances in which these favored investors (people like J. P. Morgan, for instance) manipulate policy for their own benefit.
But I don't think colonialism only helped a tiny greedy elite. Even if huge, disproportionate sums of money did go into administering and developing a colony, it wasn't as if the metropolitan country got nothing for its investment. For one thing, it provided tens of thousands of men with employment abroad and at home. Government bureaucracies and militaries expanded and techniques of administration, repression, and social control were honed, frequently to later be used domestically. The expansion of colonial and domestic bureaucracies increased aggregate demand (since bureaucrats have to eat too) and stimulated economic activity, thus growth. Raw materials extracted from colonies fed the domestic industrial machine. Strictly speaking, maybe political colonialism wasn't necessary in order to have access to these raw materials. But at a time when Western countries were feverishly competing to industrialize, it was pretty rational and probable for each to stake out large swathes of territory as theirs and keep others out. Leopold II, and Belgium, made quite a killing, so to speak, in the Congo after taking control of it.
In many cases, it's likely that the access to raw materials alone did much to justify the expense of maintaining colonies. (And again, the mere fact that something is expensive doesn't mean it's harmful. Government spending, including high levels of deficit spending, can be extremely useful for generating economic growth.) Combined with the growth of colonial markets to absorb admittedly small "surplus" amounts of industrial products—but relatively small amounts of sales abroad can mean the difference between high profits and low profits, a growing industry and a stagnating industry—these economic considerations begin to make it look quite rational to have colonies.
Besides, it is doubtful that countries would have maintained colonies for decades and sought new ones if they really, in effect, had gained nothing from them or were actively harmed by them. Surely governments would have figured this out, sooner or later. Governments are self-interested; they act to increase their power. It would be pretty anomalous for them to waste colossal amounts of resources on endeavors that, over many decades, yielded little or nothing. The sheer growth of state capacity and war-making attendant in colonization would have benefited national power and industry.
When you look at good research, it seems that having a colony could be very beneficial indeed. According to one scholar, Britain drained around $45 trillion from India between 1765 and 1938. Moreover, it has long been a commonplace of historiography that Britain's industrial revolution was made possible in large part by using India as a captive market for cotton textiles. There has been no shortage of excellent scholarship, whether Marxist or dependency-theorist or whatever, arguing that Europe gained immeasurably from colonialism (as from slavery earlier, and from imperialism generally).
As for the argument that nationalist and racist ideologies were important motivators of colonialism, sure, that's true. But, again, it doesn't get big business or capitalism off the hook. This points to a fundamental error in the usual thinking of liberals and conservatives (and postmodernists), an error I've written about elsewhere: its characteristic idealism. It attributes too much importance to ideas, "culture," and the psychology of the masses and particular leaders. I feel like I'm constantly making this point, but it bears constant repeating: these are "superstructural," superficial, second-order things, however significant they may be to individuals consciously motivated by them. What really matters is that particular ideologies are able to dominate because they serve the interests of institutions with resources, which propagate them or at the very least allow them to be propagated and don't feel the need to push back with some contrary ideology. The ruling ideas are, generally, the ideas of the ruling class. Nationalism and racism were (and are) favored by powerful sectors of business, for their own purposes. The only reason they're allowed to become "hegemonic" at all is that they serve the interests of the institutions with the most resources, namely business; otherwise, they'd be crushed by some other, more business-friendly set of ideas. These a priori considerations, based on the most elementary reasoning about how entities act (i.e., to serve their interests), are so obvious you could easily explain them to an eight-year-old. And yet most intellectuals, including postmodern leftists (who obsess over "discourse" rather than class), appear to be blind to them, and therefore embark on misguided and misleading research projects. (Exhibit A, again, is Deirdre McCloskey, an especially egregious and vulgar example of an idealist, given her fixation on a few glorious "bourgeois ideas," rather than material forces, as having ushered in the modern world.)
The nationalism and racism of the late 19th century were produced and propagated in an industrial-capitalist context, and became so culturally dominant that you can assume, even without investigation, that in some respects they served the interests of industrial capitalism. So it was industrial-capitalist structures that motivated, albeit through ideological mediation, nationalists and racists to colonize the world. As Marx would say, the ideological actors tended to be unaware of the true significance of their behavior, the real material (capitalist) causes and consequences of the policies they favored.
All in all, the excuses and apologetics of intellectuals, Milton Friedmanites and others, who want to absolve capitalism of the sin of colonialism are pathetically historically naïve and transparently partisan, motivated by a childish ideology. ("Capitalism = freedom.") These sorts of "scholars" are not to be taken seriously.
 I've been reading a couple of books about colonialism, such as Julie Greene's The Canal Builders: Making America’s Empire at the Panama Canal, so the subject is on my mind.
 Incidentally, the inevitability of worldwide capitalist growth is one reason why I think Marxists and other socialists were always wrong to hope for large-scale socialism or communism in the 19th or 20th centuries. It didn't happen and it couldn't have. Marxists continue to have fantasies about how earlier revolutions could have turned out, how opportune moments weren't seized or leaders betrayed something that could have led to genuine socialism, etc. Just read sectarian leftist websites and even the academic literature. It's all delusion, and furthermore un-Marxian delusion. History has a logic. If world revolution didn't happen, it's because it couldn't have. Only now are we entering the era—the generations-long era—when some sort of international socialist revolution is, perhaps, even possible. It's weird that so many close students of history so misunderstand it.
 This is a point that conservative critics of government bureaucracy consistently fail to appreciate or even think of. Bureaucracies = jobs, and jobs = economic activity. If you massively downsized bureaucracies there would be more unemployment, less demand, and less growth.