LYLE: Now, come on, boys, where's your spirit? I don't hear no singing. When you were slaves, you sang like birds.
Lyle has lived most of his life believing in racist stereotypes about black people, like the one about how black people love to sing. That's why Lyle is so disappointed when he finds that the black railroad workers spend their time complaining about their brutal work instead of singing.
But this is just one more instance of where Mel Brooks takes racist stereotypes and uses them to make racist people (like Lyle) look like fools.
LYLE: Okay, I'll send down a team of horses to check out the ground.
TAGGART: Horses? Why, we can't afford to lose no horses, you dummy! Send over a couple of n*****s.
Lyle and Taggart are worried about the quicksand that lies ahead in their railroad building. But when Lyle suggests sending horses ahead, Taggart tells him to send two black workers instead. The "comedy" of this exchange tells us that men like Taggart would have put a way higher values on a horse's life than on a black person's life. But the sad historical fact is that this was often true.
TAGGART: Oh, that uppity n***** went'n hit me on the head with a shovel.
Taggart spends all his days yelling at his black workers and whipping them. Then he gets really upset when one of them hauls off and hits him in the head with a shovel. Go figure.
HOWARD JOHNSON: As Chairman of the Welcoming Committee, it is my privilege to extend a laurel and hearty handshake to our new... n*****.
The people of Rock Ridge are very excited to get a new sheriff in town. But this excitement quickly turns to anger when they find out that their new sheriff is black. Once again, people's racism gets in the way of what their town actually needs— which is a new sheriff.
BART: Are we awake?
JIM: We're not sure. Are we black?
BART: Yes, we are.
JIM: Then we're awake. But we're very puzzled.
When Bart first meets Jim, Jim can barely believe that he's looking at a black sheriff. Like the other people in Rock Ridge, Jim can't believe that any government would ever put a black man in charge of white people. Then again, Jim is an alcoholic who barely knows what's real and what's a hallucination.
TAGGART: Here we take the good time and trouble to slaughter every last Indian in the West, and for what? So they can appoint a sheriff that's blacker than any Indian! I am depressed.
Taggart is depressed to see a black sheriff in charge of Rock Ridge, especially after he's put in all the hard work of exterminating or enslaving every non-white person he's come across in the Old West. Of course, the joke here is that Taggart believes that killing and enslaving non-whites is a worthwhile project that takes good ol' fashioned hard work.
HEDLEY: Yes, the first man ever to appoint a black sheriff! Just think, sir—Washington, Jefferson...
Hedley Lamarr shows that he's a great manipulator when he convinces Governor Lepetomane to install Bart as the new sheriff of Rock Ridge. Of course, Hedley knows that the townsfolk will kill Bart because he's black. But he's more than happy to sacrifice Bart if it means getting a railroad built through the town.
BART: Ah, good morning, ma'am. And isn't it a lovely morning?
OLD WOMAN: Up yours, n*****!
When Bart first arrives at Rock Ridge, he takes people's racism with good cheer and tries to win them over. But pretty soon, he realizes just how tough this'll be when old women in the street are figuratively (and maybe literally) spitting in his face.
OLD WOMAN: Sorry about the "Up yours, n*****." I hope this apple pie will in some small way say thank you for your ingenuity and courage in defeating that horrible Mongo.
Once Bart saves Rock Ridge from the attack of Mongo, people in the town learn that they're better off with a black sheriff than they are with no sheriff at all. One old woman even apologizes for her racist comments to Bart. But this doesn't necessarily mean that the whole town is ready to grow up.
BART: I'm rapidly becoming a big underground success in this town.
JIM: See, in another twenty-five years you'll be able to shake their hands in broad daylight.
Bart feels confident that he'll be able to win over the people of Rock Ridge. But as Jim reminds him, it's not like this is going to happen overnight. People might secretly support Bart, but this isn't the same thing as treating him nicely in front of the rest of the town in broad daylight.