The wonderful thing about literature is that everyone can get a different message from the same story. However, the purpose of the author writing the story can be found within the themes, character relationships and the points of view from which the story is told. Pygmalion is written from Liza's perspective, mostly; although, there are insights to others' perspectives as well, like that of Mr. Doolittle when he proclaims that he has lost his happy life when he enters the middle class.
So if you were to find the purpose of Shaw's writing through Liza's eyes, you might find some interesting questions about male-female relationships, platonic relationships, and how people can (should) treat one another. The social class system is called into question as money plays a role between those who have and those who don't. Also, an examination of how men treated women during the turn of the twentieth century is delivered in astonishing fashion from the perspective of two old bachelors.
The study guides and links below will provide you with further insight to the author's purpose.
Shaw was very interested in language and in how accents and vocabulary stigmatize people and separate classes. One of the things he wanted to show in his play was that a person could rise in social class just by changing his or her speech. This was comically illustrated in the movie adaptation, My Fair Lady, when Eliza finally learned to say "The rain in Spain falls mainly in the plain," rather than "The rine in Spine falls minely in the pline." Shaw was also an ardent socialist and wanted to end the caste system that prevailed in Britain.