For the most part, these overseas expansions of the United States were justified under the Monroe Doctrine and later the Roosevelt Corollary. The very fact that the United States was against European Imperialism is why they took foreign lands. Take for instance Cuba. After the Spanish American War, Spain had to give up rights to Cuba, but as we even see today, leaving Latin American countries to there own devices is a dangerous game, so America felt justified in becoming for all intents and purposes a protectorate over Cuba. This made sure Cuba would one day be independent (the Teller Amendment made it impossible to fully annex Cuba), and it gave the USA rights to naval bases (GITMO) and other things. The USA used the exact same justification in taking over the Philippines, and Hawaii to a lesser extent. Other interventions such as occupations in Haiti or Nicaragua had similar purposes, create a stable, independent government, and give the USA influence and power over these regions instead of Europe. So in the end the United States was against imperialism, but as her territory expanded from coast to coast, the influence that came with imperialism, combined with the Monroe Doctrine principles created a hybrid system of puppet governments that mirrors the systems of influence post WWII that we see today.
There is a great book called The Imperial Cruise about Teddy Roosevelt and the imperial policy of the time. To boil it down, the great powers had extra territory and we had just finished conquering the natives of the western US and were still in the mood for more. Also, there was the widely held belief in aryan supremacy. The book goes into great detail about our goals in Asia, which really aren't well known today.
Just wanted to add something to the above comment! In addition to its imperial interests in Latin America, there was also the idea that American democracy depended on acquisition of overseas territory. It can be seen especially in Frederick Jackson Turner's "The Significance of the Frontier in American History," more commonly known as the Frontier Thesis, presented in 1893. Essentially, conquering the frontier created the American character and spirit, and because the West had been "closed" during the 19th century, the US had to expand outwards to maintain its identity. Additionally, land ownership was/is essential to the idea of American democracy, as can be seen in Jefferson's ideal of the yeoman farmer, and the general Enlightenment ideal that land ownership = citizenship = real participation in democracy.