Nowadays we like our superheroes with a sexy dash of ambiguity; just being an unbeatable goodie with your heart on your sleeve and your pants over your trousers won't cut it. Batman, the dark knight, was the hero with a touch of maverick bad guy. X-Men were mutant übermenschen with a hint of ruthlessness. And Spider-Man is the ultimate in superhero postmodernity. He's the winner with a massive streak of loser.

It is as if his super-powers, so far from cancelling out the nerdiness and vulnerability of his civilian identity, have somehow amplified them and given them a theatrical, histrionic quality. He is easily the stupidest-looking superhero, sporting a fantastically irritating costume with its pedantic spider's-web design, and a mask apparently designed to impede both breathing and talking. If you saw Spider-Man crouching near a plughole, your first impulse would be to say, "Ugh", pick him up by one leg and throw him out of the window. But Stan Lee's classic Marvel comic creation, cheerfully revived here in Sam Raimi's movie, emerges as the strangely compulsive underdog in the superhero gallery: he doesn't get the girl; he's hated by the press; nobody can make up their mind if they love him - or even if they're all that scared of him.

Spider-Man in real life is Peter Parker, an earnest high-school student and "science whiz" in New York, and he is played by wimpy little Tobey Maguire, who, as ever, looks like a child who should be taken into care for his own protection. With his dopey, sleepy-lidded little grin, Maguire always seems to me a couple of legs short of the full arachnid. He should be wearing dungarees, chewing a straw and giggling about something horrible he's got in the woodshed. But his slight frame, delicate looks and exasperatingly meek body language make him ideal casting for the role of Parker, the studious geek obsessing about the beautiful girl next door, Mary Jane Watson: a dull, passive role in which the excellent Kirsten Dunst is wasted.

While on a tour of some sort of hi-tech insect house, Peter is accidentally bitten by a genetically modified spider - genetic alteration clearly being the funky new 21st-century version of the "radioactivity" that caused superhero transformations in the Marvel comics of old. So he imbibes the qualities of a spider. Does this mean he grows six extra legs and drools webby goo from his mouth? It does not. There is no unsightly compromise to his attractive humanity. Parker's change is a mile away from Jeff Goldblum or Vincent Price in The Fly, and a hundred miles from Kafka.

No: what happens is that Parker becomes incredibly good in a fight, is able to walk up walls and swing with extraordinary athleticism on webs between tall buildings - exactly like, erm, spiders are famous for doing. Moreover, he discovers that he doesn't need his glasses any more; and is sporting abs that are to die for. Perhaps Parker hasn't been bitten by a mutant spider at all - he's been bitten by the mutant love child of Matt Damon and Johnny Weissmuller.

But it is all carried off with such gusto it's impossible not to be swept along by the fun, and impossible not to appreciate the metaphorical qualities of the Spider-Man myth. Parker's prickling, seething, web-shooting body is both an allegory for the tumult of adolescence, and an escapist fantasy for teenage boys mortified by their own hormonal agony.

The digital effects deliver some terrifically exhilarating sequences as Spider-Man whizzes through the urban jungle, and incidentally solve the perennial question of the live-action superhero: how to stop the costume looking saggy and wrinkly. This one looks seamlessly, figure-huggingly pert throughout, and distracts your attention from the question of how he gets the webbing to shoot through the gloves, and the disturbing issue of what happens when he needs to go to the bathroom.

There is strong support from Willem Dafoe as the crazed magnate Norman Osborn, who becomes the arch-villain Green Goblin. JK Simmons also does well as the irascible newspaper chief J Jonah Jameson, who gives Peter Parker piecemeal work as a freelance photographer (again, it's a measure of Parker/Spidey's quasi-loser status that this was the job that poor Jimmy Olsen had on the Daily Planet). The real disappointment is that nothing very interesting could be found for Kirsten Dunst to do, apart from scream and simper adoringly at Spider-Man's deeply unattractive insect mask. She peels it back sufficiently to get a kiss, and there's a night-time scene in the rain patently contrived to allow Spidey's male fans to check out Kirsten's breasts in outline - as if she were the winner of some kind of noir wet T-shirt competition.

Whatever its merits, Spider-Man will always have its footnote in history as the first, spectacular casualty of September 11: a magnificent sequence showing the bad guys' helicopter getting caught in webbing between the Twin Towers had to be junked, along with much contingent narrative. This may survive as a DVD extra; but I suspect not. As it stands, the Green Goblin does his fair share of insanely destructive flying at New York buildings, but it's difficult to see this as distinctively Osama-ish villainy. What is very post-9/11, however, is an obviously tacked-on scene in which a crowd of feisty New Yorkers start throwing things at the Green Goblin. "Ya take one of us on, ya take us all on!" one shouts piously.

Absurd it might be, and - apparently - speckled with not very alarming continuity errors. But this is entertaining stuff, and Sam Raimi has spun a good yarn for the summer.