cautionary tale

Cautionary tale is a literary term referring to a narrative with a moral message warning of the consequences of specific actions, ideologies, character flaws, technologies or institutions, often with a downbeat ending. Many slasher horror films are semi-cautionary tales about one of the consequences of sex or experimenting with the occult. See also "satire," "morality tale," and "nihilism."