The use of stock characters is a means of conveying the moral of the story by eliminating complexity of personality and so spelling out the issues arising in the interplay between the characters, enabling the writer to make clear the message. With more rounded characters, such as those typically found in Shakespeare's plays, the moral may be more nuanced but no less present, and the writer may point it up in other ways (see, for example, the Prologue to Romeo and Juliet.)
Throughout the history of recorded literature, the majority of fictional writing has served not only to entertain but also to instruct, inform or improve their audiences or readership. In classical drama, for example, the role of the chorus was to comment on the proceedings and draw out a message for the audience to take away with them; while the novels of Charles Dickens are a vehicle for morals regarding the social and economic system of Victorian Britain.
Morals have typically been more obvious in children's literature, sometimes even being introduced with the phrase, "The moral of the story is …". Such explicit techniques have grown increasingly out of fashion in modern storytelling, and are now usually only included for ironic purposes. As Oscar Wilde observes wryly, The good ended happily, and the bad unhappily. That is what Fiction means.
Some examples are: "Better safe than sorry", "The evil deserves no aid", "Be friends with whom you don't like", "Don't judge people by the way they look", "Sticks and stones will break my bones, but words will never hurt me" and "Slow and steady wins the race".