Mr. Alfred Doolittle, Eliza's father, is well-suited to being a dustman because it is a low-level, low-paying job that allows him to live below the radar of middle-class life. He doesn't have to be married to Eliza's mother, and he never hears from his relatives, who try to avoid him. Nobody else bothers him, either, as he has no money. He can waltz through life in a happy-go-lucky way, drinking, ducking any responsibilities, never worrying about middle-class morality, and having a good time, because nobody cares about him.
All of this changes when Mr. Doolittle becomes the recipient of an American philanthropist's generosity in the form of a stipend of 3,000 pounds a year, an immense amount of money in that time period. The only requirement is that he give an annual speech to the Moral Reform League.
In a comic reversal, what seems to be an amazing stroke of good fortune makes Mr. Doolittle miserable. Suddenly everyone wants a piece of him, or more precisely, his money: doctors who couldn't have cared less about him are suddenly very concerned over this health, and relatives he hasn't heard from in years suddenly remember he is alive and come flocking around. Further, under the middle-class spotlight, he is forced to marry and is under pressure to behave like a respectable, upright middle-class man, an idea he hates. He was happier as a dustman, impoverished but free.