The characters of Ms. Prism and Dr. Chasuble are quite important to the play—even thought hey are secondary characters—in that they allow Wilde to go full-force in his criticism of the "polite society."
They are caricatures more than anything else. They are there to illustrate the author's point of view on two matters that Wilde criticized the most: religion and the hypocrisy of the advocates of "morality," such as Miss Prism.
Granted, Wilde mocked just about every aspect of the superfluous and sanctimonious Victorian society in the characters of Cecily, Gwendolen, and Lady Bracknell. Yet, adding Miss Prism and Dr. Chasuble to the mix adds more dimension to Wilde's criticism.
Miss Prism represents every repressed Victorian who lives by an impossible canon of moral expectations and the ridiculous social rules of decorum.
Wilde gets the last laugh by giving her a shady past as the reason why she overcompensates with her current behavior. Moreover, he gives her yet an additional dimension...
(The entire section contains 3 answers and 1045 words.)