In The Storyteller, by Saki, when the aunt says "You have undermined the effect of years of careful teaching." What does that mean?
In order to answer this question one must understand H.H. Munro's (Saki's) writing style and purpose.
Saki is a late Victorian to Edwardian-era writer whose style is very much comparable with the styles of Oscar Wilde, PG Woodehouse, GB Shaw, and Evelyn Waugh.
This being said his stories are oftenled by an idle dandy or, like in this particular story, a bachelor. Saki, in tandem with the writings of Wilde, is also fond of epigrams and contradictions in his stories. Therefore, his writings will always end in a twist.
In the short story The Storyteller, an aunt and her two nieces and nephew travelled by carriage sharing the same cart with a bored bachelor who was not related to them.
One can see that the aunt is a very prudish and annoying woman with no control of the children. She also appears to be into virtuous behavior as evidenced in the boring tale she told the children about how good people are rewarded and bad people are not.
When the children express their dislike about the story, the bachelor makes a smart comment to the aunt to which she responds angrily by challenging the bachelor to tell the children a story himself.
Hence, the bachelor tells the kids a tale about a very good little girl who gets rewarded by the Prince with medals of good conduct, and by being invited to visit the the royal private gardens. However, the ending of the story is that a wolf entered the gardens, ate the girl "in a morsel", and the only things left of hers were her three good behavior medals. This was an ironic tale which made the kids laugh and deem the girl as "horribly good" and the story as a "beautiful story".
Therefore, the reason why the aunt tells him that he has undermined the effects of years of careful teaching means that, as much as the children have been taught to be good, here comes this guy out of nowhere to switch the way they saw things: Good girls, such as the girl in the story, still got eaten by the wolf.
The bachelor simply made the bad look good in the eyes of the children to the dismay of their prudish aunt.