Mark Twain wrote "Huckleberry Finn" as a sequel to "Tom Sawyer." In his writing process, he ended up creating a satire of the supposedly civilized society in which he lived, which was actually infused with racism in spite of the abolition of slavery. This was his critique on a society that he had not censured at all in "Tom Sawyer."
Mark Twain initially wanted to portray America as it was in the 1870s and 1880s, but he grew to become something of an activist. While "Huckleberry Finn" parodied race relations, Twain himself became an advocate for African American students at Yale Law School. He paid for their tuition in an effort to make some small recompense for all that they had endured.