Apparently, Elfman didn't feel like Raimi was giving him enough freedom. Elfman wanted to play around with the music a bit, but Raimi was very attached to the music he had already created and didn't want him to change it so much. Elfman has had some pretty nasty things to say about Raimi, too.
As much as I love Elfman's music, he does seem to come off as something of a jerk. I believe the problem he had with Raimi is the same problem that caused his falling out with Tim Burton years ago. I think that says something about his attitude. Maybe he just doesn't really know his place on the filmmaking ladder. Who knows.
As for Christopher Young, I'm a little concerned. Not that I think he's a bad composer, but different composers have different sounds. And I like Elfman's sound for Spider-Man. It IS Spider-Man to me. I know they're still gonna use Elfman's themes, but I'm just not sure the new music will have the same feel.
EDIT:
Some more insight...
Quoted from Chud.com
Today the junket for The Corpse Bride junket was held in Toronto, at the Toronto Film Festival. The junket in general was short on news - Tim Burton is taking a break, Helena Bonham Carter has a few things in the hopper and Johnny Depp is still knee-deep in Captain Jack Sparrow (his mouth was full of gold teeth). But Danny Elfman dropped a surprise on me when I asked him whether Sam Raimi had told him which villains for whom to consider themes. He’s not doing Spider-Man 3, he told me. I asked why.
Elfman: Spider-Man 2 was a miserable experience.
Q: Why? Was it too fast or –
Elfman: It’s a complicated thing.
Q: Why was it complicated?
Elfman: My connection to Sam got completely severed. As far as I’m concerned, he went to sleep and somebody put a pod next to him and when he awoke, he wasn’t the same person I’ve known for a decade.
Q: Will you work with him again?
Elfman: No. He went from right there, number 2 on my list of favorite directors, to the last – to the exact opposite of everything I look for in a film experience. Everything I could do on Spider-Man 1 I couldn’t do on Spider-Man 2. He got so intensely attached to the temp music, I couldn’t even adapt my own music. I couldn’t get close enough to me.
It’s the first time I’ve ever walked from a director in twenty years, and hopefully the last time. He became intolerable. I’ve been on some heavy duty films, so to say that it had to be pretty bad. I have been in war zones you wouldn’t believe in 55 films. But this is the first time I’ve said, I’ve had it. It’s just not worth it. I would rather go back to waiting tables than to do Spider-Man 2 again.