While most of Maycomb's citizens prove themselves to be racist through their views of Atticus's work in proving Tom's innocence, Dolphus Raymond represents another facet of their white society.
Earlier in his life, Dolphus was engaged to be married to a white woman. According to the rumors Jem passes on to Scout, his soon-to-be-bride found out that he was having an affair with a black woman and killed herself. This is especially shocking since Dolphus was from a "real old family," a social standing which people like Aunt Alexandra value.
Later in chapter 20 when the children actually have a chance to talk to Dolphus, they are shocked to learn that he isn't the town drunk he pretends to be. He explains to Scout and Jem that he actually prefers the company of black people, but Maycomb could never understand this. Instead of just saying "the hell with 'em," Dolphus tries to give everyone a reason to explain his choices, which white Maycomb would find otherwise impossible to explain:
It helps folks if they can latch onto a reason. When I come to town, which is seldom, if I weave a little and drink out of this sack, folks can say Dolphus Raymond’s in the clutches of whiskey—that’s why he won’t change his ways. He can’t help himself, that’s why he lives the way he does.
Giving people this "reason" to explain his otherwise unfathomable choices ultimately makes things easier for Dolphus and his family to build a life in Maycomb—at least until the children get a little older and head to the North. Dolphus is willing to sacrifice facets of his own reputation in order to live the way he wants and avoiding constant conflict for his choices.
His role in the novel shows Scout that there are people who will deliberately perpetrate fraud against their own character in order to find a bit of peace and uphold a greater goal. Because he understands the complexities of their white society, he also delivers an ominous line to Scout as they part company:
You haven’t even seen this town, but all you gotta do is step back inside the courthouse.
Dolphus knows the way this trial will end because he has seen the ugliest side of their town. His words foreshadow the ultimate decision the all-white jury will therefore reach.