I think that Mark Twain wrote the above passage in protest to the government's action of :
The American annexation of the Philippines, Guam, Puerto Rico, and the brutal treatment of the Filipino people
This annexation happened under the Treaty of Paris of 1898 wherein Spain relinquished Philippines, Guam, and Puerto Rico to the United States.