Shaw does use Doolittle to express his views about the class system. Throughout the play, Shaw lets us know that all people are fundamentally of equal worth and that the social differences between them are merely the result of different levels of opportunity.
Doolittle goes through his own transformation from a dustman into a lion of London society, becoming a victim of middle-class morality. He doesn't care what people think of his appearance or language. He makes scandalous remarks, but with humor and wit. Higgins calls him "the most original moralist" in England. When Doolittle inherits the money and becomes a lecturer for a moral reform society, he's not happy with his new class identity. Being middle-class and respectable was never his goal. Newfound wealth has brought him pain instead of pleasure. He's no longer free to behave in his casual and slovenly ways. He must behave with middle-class morality, and that's why he says he is "damned" by it. The irony of this is what helps Shaw make his point.
Doolittle ends up being the symbol of middle-class morality when all that really changes about him is money. The shallowness of the middle class welcomes Doolittle now that he has money, and his behavior is welcomed by them because those born into the life are so bored with each other. They welcome his fresh voice.