Claude McKay, though a central figure in the Harlem Renaissance, was not African American, but Jamaican, and he was horrified by the levels of racism he encountered upon his arrival in the US at the age of 23. Segregation in particular struck him as bizarre and dehumanizing, and this drove him to write a number of rallying poems aimed at black Americans, urging them to fight against what he saw as animalistic treatment of their society. This poem, which depicts blacks as "hunted and penned in some inglorious spot," highlights McKay's particular horror of segregation, which "penned" the blacks as if they were, to the aggressors, "hogs."
Note the orientation of the extended metaphor: it is only in the eyes of "the monster," aka white society, that the constrained blacks are "like hogs." The poem uses fairly aureate and traditional diction ("accursed," repetition of "O," "making their mock," "kinsmen") to emphasize how incorrect this assumption is: though the whites may behave like "mad and hungry dogs," it is only because of their madness that they cannot see how "precious" is the blood of those they oppress.