It is sometimes true that a reliance on stock characters may be seen by some critics as a lesser form of art; however, comedy and satire often do employ stock characters as part of the author's purpose. In the case of Oscar Wilde's The Importance of Being Earnest, the characters are not exactly stock characters, but the way the characters mirror one another, each lacking originality in their own right, certainly helps Wilde critique the behaviors and beliefs of the Victorian upper class.
The protagonist, Jack, is a bit unusual in the sense that he is apparently an orphan but was adopted by a wealthy man and thus permitted to live a life of luxury. Once his guardian dies, though, Jack must care for the man's granddaughter Cecily, who is now his ward. Partly as a way to escape his responsibilities at his country estate, Jack goes by the name Ernest in London, where he is friends with another excessively wealthy man, Algernon. Like Jack, Algy is not exactly cut out for the strict Victorian expectations and invents an invalid friend he calls Bunbury. Whenever he wants to get out of an obligation, he invokes Bunbury, who is always ill and always needs Algy's support. In act 1, the men discover their very similar schemes, though Jack is sure he is nothing like Algy.
Later in act 1, we meet Gwendolen, who is Jack's love interest and Algy's cousin. In a particularly telling scene, Gwendolen confesses she loves the name Ernest and will only marry a man by that name. When we move on to act 2 and meet Cecily, the same scene is enacted between Cecily and Algy, who is now pretending to be named Ernest. In these scenes, Wilde intentionally mirrors the women's reactions, even includes some of the same lines, to draw parallels between the women's characters (and the men's, as well). Ultimately, upper-class women are depicted as superficial and frivolous, while upper-class men are shown to be deceitful, careless, and selfish.
The similarities Wilde highlights between characters by repeating scenes in which the women profess their love for "Ernest" and the men are revealed to not be "Ernest" (or "earnest") work toward a send-up of Victorian marriage customs and the absurd behaviors of the upper class—those with too much time on their hands, clearly. The women's obsession with the name Ernest exaggerates the upper class's obsessions with family names, status, and power. The silly behavior of the two men critiques the society's too-strict expectations for both sexes.