In The Philosophy of Horror: Or, Paradoxes of the Heart, the well known philosopher and film theorist Noel Carroll argues that our perverse desire to be terrified by horror films has its root in our sense of awe toward the unknown. Being scared by horror films inspire this kind of awe according to him.
This explanation, while making sense, never fully satisfied me. My own theory has been something that can be called a masturbation theory of fiction. It goes like this:
(1) We as a species developed through evolution a host of emotions that are functional for our survival and therefore for procreation (despite their potential for backfiring, especially in the modern world). Anger provides us with a surge of energy for a (necessary) fight. Sadness keeps us from wasting precious energy in futile efforts. Fear and disgust drive us to adopt protective behaviors (running away, ducking down, turning way, throwing up, keeping distance, etc.).
(2) Any systems, once in place, need to be activated on a regular basis. So do emotions. In early days of the human species, there were plenty of immediate and "legitimate" triggers for these basic emotions. In the modern world, we don't have to worry about lions attacking us or wolves stealing our food. In the modern world, our emotions work largely on the plane of the social and psychological rather than that of the physical. I also suspect that they are not exercised in enough frequencies and intensities. Therefore, we invented a gym for exercising our underused emotional muscles, which is the genre fiction.
But then, we are a more complicated species than just that. More often than not, horror films do much more than just stimulating our fear circuits, but tie our reptilian experience with what might be called the cerebral. The result is a fatal concoction of the conceptual and the primordial -- the idea felt urgently in your gut.
In Dario Argento's Opera (*spoiler*), the young opera singer's plea not to be another version of her mother, but a person of her own, is expressed acutely through the horror story. Roman Polanski's The Tenant addresses the issue of identity. Even our ordinary vampire stories and zombie movies is about our fear of giving oneself up to a passion or preserving one's "soul."
(But then, some horror movies are hardly more than pornography of another kind.)
Finally the point: All this rambling is brought to you by my experience with a recently machinima piece called Destiny's Keeper by Keith Eiler (a.k.a. malletpropstudios, a.k.a. Gnasche). It is a well made movie with a Lynchian feel to it. The story can be a little bit cryptic at first view, especially if you're distracted (?) by the disturbing (by which I mean 'great') sounds and visuals. But once you get the story, the horror is elevated to a whole other level. Watch it here or below.
Careoll, N. (1990). The Philosophy of Horror: Or, Paradoxes of the Heart. New York: Routledge.