A quick search led me to David S. Reynold's Article "Politics and Poetry: Whitman's Leaves of Grass and the Social Crisis of the 1850s". This article essentially explains that Whitman was supportive of the Wilmot Proviso, which was against the desires of President Polk, a man that Whitman had earlier followed. However, the article explains that "Whitman was an antiextensionist: one opposed to the extension of slavery into the western territories. As was true with most antiextensionists, his main concern in 1847 was not the slaves themselves but rather the disruptions of American institutions posed by the South's apparent effort to put its own interests above those of the nation." More than anything, Whitman opposed the dissolution of the nation and was fiercely critical of the Abolitionist.
This information is surprising, considering Whitman's position in "Leaves of Grass" when he housed and aided a runaway slave. Why is it then, that a man who desires to help gain freedom for slaves also be against the abolitionist movement? The article compares Whitman to Abraham Lincoln in the sense that both were more interested in keeping the union together over the actual emancipation of slaves.
"One can only guess what his racial opinions were in childhood, although the vibrant presence of African Americans in Brooklyn in the 1820s and his long-remembered friendship with an ex-slave named Mose suggests an openness to African American culture. The rise of abolitionism in the 1830s seems to have pushed him, like others, to a fearful conservatism."
Whitman was not entirely unaffected by the tense atmosphere of his time. Although it seems that Whitman was respectful of African Americans, the article suggests that Whitman was conservative on his views on slavery. However, it seems that when he wrote "Leaves of Grass" he had taken a more progressive and liberal view on the subject.