How did European countries justify their imperialism?
Many Europeans who supported imperialism argued that new colonies, and the new markets they brought, were necessary to avoid over-production, which would lead to economic depression. (Opponents of imperialism, such as John Hobson, said that was nonsense, but it was the reason that Lenin described imperialism as the "final stage of capitalism.) Also, it's important to note that many examples of imperialism, especially British imperialism, began with investment in foreign countries. When political events in those countries jeopardized the capital invested in them, business leaders prevailed on governments to intervene militarily, which sometimes lead to almost direct rule. This happened most obviously in Egypt.
The issue of raw materials, as well as the "White Man's Burden," both referenced above, were very important, as was social Darwinism, which justified imperialism as part of a natural stuggle between races.
One of the more intriguing arguments imperialism is that the acquisition of colonies in Africa and elsewhere tended to distract from the class struggles prevalent in the industrialized European societies. Leaders appealed to patriotism and to the jobs that imperialism supposedly created to get popular support for acquiring territories overseas.
There were a number of ways in which European countries justified their imperialism.
Some of the justifications had to do with necessity. They argued that they needed to take an empire because they needed the resources from the places they imperialized. They argued that they needed empires so as to keep up with the other European countries. These justifications are based solely on need, not on the idea that imperialism was good for those who were colonized.
There was another strand of justification, though, that did argue that imperialism was good for the colonized. This can be best seen in Rudyard Kipling's poem "The White Man's Burden." In this view, the people who got colonized were lesser people who needed to be civilized and brought into the modern world. The idea was that imperialism was a positive good because it helped those people come out of their "backwardness" and become more like modern Europeans.