Dave's remark indicates the context of this novel and the widespread problems of racism that African-Americans faced during the first few decades of teh twentieth century. Let us remember that blacks were facing oppression through the "Jim Crow" segregation laws at the time, which legally sought to reduce the life chances enjoyed by blacks through a state system that was itself racist.
In addition, as the title suggests, this novel is about Dave's struggle to reach manhood and be respected, and African-American masculinity was something that was challenged at this time. Between 1890 and 1920, around two thousand African Americans, with most of them being male, were lynched by angry mobs. The common excuse that triggered a lynching was the rape of a white woman by a black man, though reasons could be as simple as having an altercation between yourself and your white landowner or not selling your cottonseed to a white man at the price he is willing to pay. Dave's comment about being treated like a mule and beaten like one therefore seems to act as some kind of metaphor for the way in which black Americans were treated in society.