Mark Twain was a member of the American Anti-Imperialist League, along with Andrew Carnegie, Samuel L. Gompers, and others. They were primarily opposed to American acquisition of the Philippines. Their argument, which Twain supported, was that American acquisition of the Philippines undermined democracy itself and violated every principle this country stood for. Additionally, the Monroe Doctrine had held that America's interests were exclusive from the rest of the world, and American imperialist policy violated the Doctrine. They argued that it was inconsistent to free Cuba, which had been done by the Treaty of Paris of 1898, and yet annex the Philippines. Finally, they argued that this could be the "Achilles Heel" of the U.S., as the Philippines would be impossible to defend. Twain's opposition was framed in a famous essay: To the Person Sitting in Darkness
Mark Twain believed strongly in the idea of democracy and in the idea that people should be free. You can see this sort of attitude revealed in many of his books. For example, in both A Connecticut Yankee in King Arthur's Court aned The Adventures of Huckleberry Finn we see Twain showing that he thinks that monarchy and elite rule are corrupt institutions. He shows that he believes that the common people should be give the chance to rule themselves. He clearly believes in the American way.
Twain applied this way of thinking to his thought about imperialism. He did want other countries to become more like America. However, he thought that imperialist countries (including the US at the time) did not mean to try to actually improve the countries that they took as part of their empires. He thought that they, instead, were just trying to exploit those countries. This is why he opposed imperialism. You can see that idea in the following quote from the historywiz.org link below
I said to myself, here are a people who have suffered for three centuries. We can make them as free as ourselves, give them a government and country of their own, put a miniature of the American constitution afloat in the Pacific, start a brand new republic to take its place among the free nations of the world. It seemed to me a great task to which we had addressed ourselves.
But I have thought some more, since then, and I have read carefully the treaty of Paris, and I have seen that we do not intend to free, but to subjugate the people of the Philippines. We have gone there to conquer, not to redeem.