Moby's apartment in New York doesn't look like the home of a million-selling pop star. A tin of soup rests on the draining board; shelves strain beneath the weight of records. Only a wall of gold and platinum discs - for 2005's Hotel, 2002's 18, and 1999's global mega-hit Play - give him away.

Like Moby, the apartment block in Little Italy has history. Iggy Pop, Sonic Youth and the Beastie Boys used to rehearse in the basement. Dinosaur Jr's old label, Blast First, had US offices downstairs. And now? "It's filled with wealthy Europeans," sighs the building's longest-standing resident (he has lived here for 15 years). "It used to be little old ladies sitting in their apartments and Latino kids selling crack on the corner. Now it's expensive shoe stores. If I let myself, I can get wistful about the changes."

Moby's latest album, his sixth, is very wistful. Arriving at a time when dance has been revitalised, Last Night is what Moby terms a "eulogy to New York dance music". Lying somewhere between dance's present and past, the album is full of eerily innocent, euphoric rave tunes that are quaint and oddly touching rather than being actually nostalgic. Moby has been an evangelist for veganism and environmentalism, but at the moment he sees himself as an evangelist for "over-the-top, piano-driven rave music", which he has loved since his days dancing to Todd Terry and FPI Project in the New York clubs of the 80s.

Partly, the album has been inspired by his return to DJing after a long break. But the scene is different now. He has to tell promoters to turn the lights on the audience, not the "43-year-old guy trying to play records". Not that everyone has welcomed his return to the decks. A recent review in Village Voice began by saying the writer had never understood why people despised Moby, and ended: "Maybe I hate him after all."

"I'm trying to work out what I've done that is so loathsome," he sighs. "All I did was turn up and play some records." He suspects that the same parts of people's brains light up when they sit at a computer and type "Lindsay Lohan is a whore" as when they smoke crack. He reckons that some people have never forgiven him for espousing causes, such as environmentalism, that have since become mainstream. Moby is still opinionated - he lays into corporations and the Iraq war via his MySpace blog - but he remains bothered by his public image as some carrot-chomping, tree-hugging, God-bothering oddball. As he says, he has attended sex parties, doesn't consider himself a Christian and has taken so much ecstasy his brain turned into "Swiss cheese".

"I can imagine writing a sketch comedy about a former indie straight-edge geek who wants to improve his street cred," he says with exasperation. "He'll have Chilean hookers, syringes shooting crystal methedrine in public, and people will still say: 'There goes the indie vegan Christian'.'"

Moby says his past admissions of hedonistic behaviour were only the tip of the iceberg, but he kept mostly quiet so as not to unduly offend those fans attracted by his "straight-edge reputation". But he now admits to ending up in therapy for substance abuse. He finally stopped taking drugs when the extent of his memory loss left him fearing he'd end up "the person at parties gibbering and rocking quietly in a corner". The sex parties lost their appeal, too. "Liquor and drugs diminish your inhibitions and you connect with people you wouldn't connect with when you're sober," he muses. "I find myself longing for that sober connection - intimacy with one person over a long period of time, as opposed to periods of intimacy with a bunch of people." Moby lives alone. He admits relationships are difficult because he hasn't had much practice, and sounds wistful again.

In a flash, though, we're talking about his first love, music, and how delighted he is that the kids discovering dance music in New York clubs have never heard of Todd Terry, or even Moby. "They're not historians, they're fans, hearing 25-year-old records that I grew up with." A hint of nostalgia again. One of the new album's standouts is an old-school house screamer, Everyday It's 1989, referring to a time when nobody had heard of Moby.

Maybe nobody is suited for fame, but the outsider raised by a single mother in Connecticut who brought hardcore-punk performance values (equipment trashing, standing on keyboards) to techno was perhaps more unprepared than most. When Play went supernova in 1999, the former shy kid became a real-life Forrest Gump, attending every red-carpet event and "sleazy awards show" before realising he didn't like celebrity very much and that everyone in that world was miserable. The stars are miserable because they're "insecure narcissists" driven by "inadequacy and self-loathing", desperate for fame and attention because it validates them as human beings. The people buying the celebrity magazines are miserable because "they see Puff Daddy and Jessica Simpson on a yacht in St Bart's and think it's a fantastic life. It's not. It's a depressing life. They're not attractive in reality because they spend hours with stylists making them attractive. The only people happy in it are the ones that aren't very bright."

He says, pointedly, that "the average life expectancy of a celebrity is 20 years less than someone working in a coal mine".

One of the more curious aspects of Moby's supernova period was that he ended up producing a track for Britney Spears, which makes him better placed than most to comment on the mother of all celebrity meltdowns. He found her bright, self-aware, curious about culture and "weirdly introspective. She didn't seem vain." And now?

"I think what's happening is the combination of hardcore substance abuse coupled with ... she doesn't know who she is," he says. "She became an international icon aged 16. My armchair dilettante psychoanalysis of what's going on is she's punishing herself and saying to the world, 'You loved me when I was a 16-year-old ingenue, do you love me now I'm a 26-year-old drug-damaged person?' In a weird way she's challenging people, but it's breaking my heart because ultimately she's not doing things on a symbolic level. Cutting your hair off is symbolic. Losing your children and becoming a drug addict is not."

Moby's success arrived when he was34, but the big difference between him and Britney is that he never particularly wanted it. "It's like dealing with hunger by eating candy floss," he says. "I'm not in any way saying, 'Woe is me'. I'm just saying it's a corrosive institution and I don't understand why people pursue it."

When Play first came out, it bombed. He can recite the bad reviews, such as the one in LA Weekly - "There's a song on this album which asks Why Does My Heart Feel So Bad?, and the reason is because I'm listening to this album." But suddenly Play started being played in clothes shops and appearing on adverts. He got flak for that, though everybody does it now, but says it was a natural way for people to hear his music. They just heard it, and bought a copy. Ten million of them.

"There was no plan," he says, pointing out that he had "killed" his career in the UK by leaping genres with Play. "I don't know if it was unintentional or intentional," he says, chuckling at the irony that an amazing reversal in fortunes was brought on by "a lo-fi record made on crappy equipment by a bald 34-year-old guy where the majority of [sampled] vocalists were dead African vocalists".

In the apartment where it all happened, a familiar hat nestles on a stool. It was given to him by David Bowie, who wore it in The Man Who Fell to Earth. There is an upside to all this, then? Moby smiles. He doesn't deny enjoying the "bizarre trajectory" of fame and being able to hang out with his heroes, bashing out Echo and the Bunnymen and Clash songs in a bar with Ian McCulloch and Mick Jones, and singing Walk On the Wild Side with Lou Reed.

At one point he sang New Dawn Fades with the surviving trio of Joy Division. "Knowing that the last time they played it Ian Curtis was alive ... " He falters. "And because they hadn't played it since 1980, I had to teach Barney and Hooky their own song. Which has four notes!" He shakes his head in disbelief, and suddenly Moby is 15 again, transported to the days when he wasn't good at school, girls had no interest in him and Ian Curtis was "my best friend, even though he was dead and I never met him".

Moby had a revelation at that age: that his heroes - Curtis, Bowie, punks, his favourite writers - were all celebrating outsiderness. Now, equally unwelcomed by dance purists and the mainstream, Moby is an outsider again, though financially secure. He prefers shuffling to the deli at 4am to being photographed at celebrity parties, no longer has so-called close friends reacting to his success by breaking into his house and trying to sleep with his girlfriends, and is determined to make "less compromised records".

"If I could rewrite history, I'd have made Metal Machine Music - an extreme, uncompromising record - as the follow-up to Play," he declares. "I don't have to care about making money, and I'm extremely grateful because I can deal with people without wanting anything from them, and that's extremely liberating. I want to make music forever, and I feel very fortunate if people are listening."

I ask if he thinks he's retained his integrity. He looks particularly wistful.

"At times I've taken my integrity behind the barn and put it out of its misery, and at times I've held on to it arbitrarily. I've made tons of bad decisions and done tons of things I regret. But it's an interesting process."

· The single Alice is released on March 17 on Mute. Last Night follows on March 31.