Shaw was a Fabian, part of a group that believed socialism could be achieved peacefully, without a revolution, putting him at odds with the Marxists. But both groups shared the belief that economics, not inborn "character" or "nationality," determines social behavior. Shaw shows this through Alfred.
For example, while Higgins attributes Alfred's dishonesty to being "Welsh," and asks if he has any (middle class) moral values, Alfred explains why he doesn't: "Can't afford them, Governor. Neither could you if you was as poor as me. Not that I mean any harm, you know."
Alfred, when pressed on his morality in wanting to sell Eliza for gain, goes on to say:
I'm one of the undeserving poor: that's what I am. Think of what that means to a man. It means that he's up agen middle class morality all the time. If there's anything going, and I put in for a bit of it, it's always the same story: "You're undeserving; so you can't have it." But my needs is as great as the most deserving widow's that ever got money out of six different charities in one week ... What is middle class morality? Just an excuse for never giving me anything.
In this statement, Alfred exposes the hypocrisy of middle-class "morality": it is simply the way those with more money hold down those with less, an ideology or false consciousness that says the middle class "deserve" their wealth. This morality is self-serving to the core, a way to uphold a class structure the socialists wish to abolish.
Later, when Alfred is left 3,000 pounds a year from the Predigested Cheese Trust, he exposes how the money changes the way people treat him: he hasn't changed a bit, but now is kept longer at the hospital if he's ill because he has money to pay, has to have servants to keep his house clean, and has 50 relatives where he once had none. He hasn't changed, but money changes how he is perceived. In Alfred, as in Eliza, Shaw punctures the myth that middle-class people are somehow different from and more deserving than the poor. Alfred thus stands as an argument for the more equitable distribution of wealth desired by the socialists.