The Devil, so they say, has all the best tunes. Why is evil so irresistibly glamorous? Why is it that when I told my 12-year-old son that I was writing a book on evil he replied "Wicked!"? Virtue may be admirable, but it is vice we find sexy. Nobody would have an orange juice with Oliver Twist if they could have a beer with Fagin. As Oscar Wilde remarked, anyone who doesn't find the death of Dickens's saintly Little Nell uproariously funny must have a heart of stone. We all love to boo a villain, whether it's Colonel Gaddafi or Simon Cowell. Popular culture is obsessed with ghouls and vampires, zombies and monsters; this Friday, cinema's archetypal evil guy, Freddy Krueger, returns in a remake of Nightmare on Elm Street. Nothing is more delightful than being scared to death.

When did evil start to look so alluring? One answer might be: when goodness began to look boring. We can blame this on the puritanical middle classes. It is they who redefined virtue as thrift, prudence, meekness, abstinence, chastity and industriousness. It's not hard to see why some people should prefer zombies and vampires. Goodness came to seem negative and restrictive. As the poet Auden wryly remarked, the Ten Commandments consist in observing human behaviour and then inserting a "not".

Yet goodness hadn't always been as dreary as this. For some ancient thinkers such as Aristotle, it was really a matter of knowing how to enjoy yourself. It meant learning how to flourish as a human being, developing your humanity to its fullest, finest extent. Being human on this view is something you have to get good at, like playing the tuba or tolerating bores at sherry parties. For Aristotle, it had an intimate link with happiness. Being virtuous for him was the quickest route to well-being. The good man or woman is one who excels at the precarious business of being human. Those who become really brilliant at being human – the saints – are the virtuosi of life, the Pavarottis and Wayne Rooneys of virtue. Goodness is a kind of joie de vivre, a source of energy and high spirits. As for the New Testament, it is about enjoying an abundance of life, not about paying your taxes and rolling in for work on time.

On this view, vicious people are those who have never got the hang of human existence, as someone might never get the hang of playing poker. They are lacking, deficient, incapable of being truly alive. The evil are not really there. They are unfinished sketches for real human beings. Like ghosts, they hover between life and death, trapped in some limbo that cuts them off from the human world. They may look human enough but, like aliens in a horror movie, this is just a phoney appearance.

Evil may look flashy and seductive, but if you poke it, it crumbles away to nothing. It is as bogus as Gordon Brown's smile. The philosopher Hannah Arendt, watching the Nazi genocidist Adolf Eichmann on trial in Jerusalem, realised that the most striking thing about evil was its banality. Eichmann looked like a harassed bank clerk, not a swashbuckling villain. He was the supreme bureaucrat. Bureaucrats don't like untidiness, and nor does evil. The evil are revolted by the sheer messiness of human existence. They are purists who prefer the perfection of death to flesh and blood.

So how do evil individuals try to persuade themselves that they are alive? The answer is simple and chilling: by tearing other people apart. The only thing about them that is not quite dead is the pleasure they reap from destruction. In this sense, the evil are basically sadists. Hitler's henchmen killed Jews because they saw them as a threat to their own purity of being. They represented an insidious form of non-being which threatened to undermine the Nazis' own identity. Yet Jews also symbolised a frightful negativity that lay at the heart of the Nazis themselves, which is another reason why they had to be exterminated. Beneath the rallies and racial fantasies, the bombast and the marching bands, the Nazis were pure nihilists, in love with death and annihilation. If they were crazed idealists, they were also utter cynics who delighted in smashing all human meaning and value to pieces.

Pure evil detests the very fact of human existence and wants to wipe it from the face of the earth. It can see nothing in humanity but a pathetic sham. It is out to demonstrate that the whole of human life is as empty as itself. Hell is full of the sniggers and guffaws of those who believe they have seen through the pretentious façade of human existence. It is a place of farce as well as agony, mockery as well as misery. It is populated by cynics and buffoons as well as by torturers and rapists.

This is why evil is also entirely pointless. Common-or-garden wickedness generally has a purpose. Stalin and Mao murdered countless millions of men and women, but they did not do so just for the hell of it. There was a political point to their atrocities. It is much harder to see the point of the Holocaust. Making a bogeyman of Jews helped to unite the German nation, but you do not need to slaughter six million of them to do that. The so-called Final Solution tied up equipment and military personnel that could have been useful in the German war effort. It also disposed of men and women whose skills the Nazis could have exploited.

The Holocaust cannot be understood in terms of everyday utility. Its obscene excessiveness of all purpose was part of its point. It was an orgy of meaninglessness as well as an unspeakable tragedy. The slogan over the gate of Auschwitz – Work Makes You Free – was intended as a cynical jeer, not an uplifting sentiment. Tragedy usually presupposes a sense of human value. You would not be moved by the sufferings of Lear if you thought human beings were worthless. The Nazis, by contrast, were beyond tragedy because they were beyond a sense of human value. They wanted to murder meaning as well as people.

One of the most grotesque aspects of the concentration camps is the way so much meticulous organisation was pressed into the service of such complete nihilism. Modern states are rational, utilitarian set-ups, which do nothing without a soberly calculated purpose. It is astonishing, then, to find a kind of monstrous act of public meaninglessness at the very heart of modern history. Destruction for destruction's sake is almost always confined to the private sphere, as with the Moors murderers.

One of the most frightening aspects of Ian Brady and Myra Hindley is that they did not seem to be mad. Mad people sometimes do pointless things, but when sane men and women destroy just for kicks, we are in the presence of something beyond mere immorality. The boys who murdered James Bulger seem to have destroyed just for kicks as well. Yet if they were born evil, as some have suggested, this means that they are innocent. You cannot be held responsible for your genetic make-up, any more than you can be responsible for having cystic fibrosis. To damn people as evil from birth is actually to excuse them. The same goes for goodness. If people are born good, then it would be as pointless to congratulate them on their selfless behaviour as it would be to congratulate them on having red hair and freckles.

If evil exists largely for its own sake, it has an unnerving affinity with good. The Devil, after all, was once an angel. God is portrayed by theologians as existing entirely for the sake of his own self-delight. He did not need to create the world, and nowadays, given its bloodstained history, he is no doubt bitterly regretting that he ever did anything so rash. Like God, goodness is its own reward. In fact, it had better be, because it isn't likely to get any other pay-off in this world. If the very word "virtue" has a mildly ridiculous Victorian ring to it, it is partly because there is something absurd as well as admirable about the good. In a predatory world, they are bound to appear rather wet behind the ears. There is something nerdy about goodness. Trusting, warm-hearted people are likely to be taken for a ride by rogues and tricksters, as so often in the English novel. The good are bound to end up as victims, and nobody wants to be that. This is another reason why we prefer Fagin to Oliver, whose prim little Standard English accent belies the fact that he was brought up in a workhouse.

If the evil are dedicated to destruction, then like Milton's Satan they are bound to be in a permanent sulk. This is because they need things to exist in order to put their foot through them. And this means that they are parasitic on goodness. Even so, putting your foot through something can be intensely creative, as toddlers are aware. For some people, heaving a brick through a stained-glass window is a lot more creative than actually designing it. We all derive pleasure from destroying, which is one reason we enjoy violent movies. The evil are just those people who live this out in practice, killing simply for the hell of it.

This, gratifyingly enough, is pretty rare. It is just that when it does happen it tends to happen in a big way. One reason why it is rare is that in order to reject goodness, the evil must first have some experience of it. Otherwise they are not wicked, simply ignorant. In traditional religious doctrine, nobody can go to hell unless they have deliberately turned down the love of God. "I shit on your love!" the doomed protagonist snarls at his maker in William Golding's novel Pincher Martin. But it is surely doubtful that anyone could have a taste of, say, human love and find it completely futile. Men and women who maim and exploit are not usually evil. It is rather that they have never had any real experience of love in the first place. Even a mild deprivation of love can be enough to turn us into monsters. There is no need to enlist the aid of horned devils for this to happen.

There is another sense, however, in which destruction for its own sake is an everyday affair, at least if Sigmund Freud is to be believed. Freud believed we reaped pleasure not from annihilating others, but from laying violent hands on ourselves. In his view, there is a yearning for death at the core of our being. And one reason why this death wish can become so terrifyingly powerful is that we actually take pleasure in it. The poor, battered ego relishes the idea of escaping into nothingness. When this desire becomes irresistible, the result may be suicide. Nobody would kill themselves unless there was something in it for them.

The suicide says "no" to life because it has become an intolerable burden. It is not usually existence as such they reject, just their own unbearable bit of it. Really evil people, by contrast, are out to abolish existence as such. In their eyes, being as such is bad. But you cannot abolish being as such, which is another reason why the evil are in such a sulk. In the words of a character in Dostoyevsky's The Brothers Karamazov: "The satanic demand that there be no god of life, that God destroy himself and all of his creation. And they shall burn everlastingly in the flames of their own hatred, and long for death and non-being. But death shall not be granted them."