Everyone, keep in mind that it was the 70's
The civil rights movement was still going on and racism was still a part of the world so hollywood played on that theme with the black films, in addition to wanting to make action films. The idea that a black man cna come to a white town and become sheriff in the old west is a story that has to be told.
And if you know anything about fred williamson movies they always have action.