What were the major philosophical attitudes during Mark Twain’s lifetime?
First, you must situate the story to analyze the historical context under which such philosophical attitudes bloom: His most prolific work, through which he expressed society's character, were written in the 1880's, where industralism in America was rampant, and corporate America was beginning to set in, giving people a taste of capitalism and wealth versus poverty. Hence, this is why you see a continuum in his works where he touches on greed, class status, the preocupation with material things, and the beginnings of the "keeping up with the Joneses" attitudes. Huck Finn is the embodiment of many of those preocupations.
Along with industralization came urbanization, which began separating people's living spaces onto financial strata. The rich could settle in some parts whereas the poor tended to clump together and enjoy less personal space, while also working long hours in the industry to at least have enough to eat. Hence, social standing was also a philosophical preocupation of the times.
Lest we forget the mentality of agriculture and the stubborness of the post Civil War Southern society, still bitter and left incapacitated by the War, and by the Emancipation proclamation. So, what we have is an society overly preocupied with class, status, industry, business, and growth, yet still stuck to its history and the times gone by. Its a paradoxical clash of past, present and future, all in one.