Shaw, like many other peers of his time, were very observant of the massive social divide between the different social classes, the working classes, artists, and the middle class. The typical Victorian so-called genteel society was very hypocritical because they would chastise, condemn, judge, and shun whoever person they would consider a "lesser" and would place themselves in a "holier than thou"position to make others feel bad.
It just so happened that Shaw was quite fed up with this and created the character of Mrs. Warren, a prostitute and a Madam who was quite successful in her field and possessed very unique qualities of overall good character, with the exception of course of her job being so controversial and, well, immoral.
The fact that, other than her job, she would have fit perfectly between the higher classes with her good manners and temperament was a direct blow at the Victorians, since they were all about outside appearances. Having a character like Mrs. Warren shows that aside from her work she was not at all that different than them, nor them than her.