At the time, Joss Whedon stopped short of saying that it had to do with injecting some life (pardon the irony) into the dark and less well-received Angel spin-off.
We do know, however, that he was mulling whether to ship him over to Angel even before his death in Buffy. From a 2003 interview with Whedon:
WHEDON: It wasn't until the last minute that it was actually decided that he was going to be a regular on the show. When I spoke to you, a) it was true that we didn't know his status, and b) he was about to die on Buffy, so the less about him being on Angel in the press beforehand, the better.
The fact that it was seen as a ratings boost is implicit in this:
INTERVIEWER: Fair enough. But couldn't the WB hold off on announcing it?
WHEDON: There was no f---ing way. They were very excited about James. They have a shiny blond thing to show people, and they're gonna do it.
However, the medallion's link to Spike's resurrection doesn't seem to have been planned necessarily from the outset, but it could be one the "other ideas" that Whedon refers to below:
INTERVIEWER: So, how do you plan to resurrect Spike?
WHEDON: That's a conversation I'm going to be having with the Angel writers very soon.
INTERVIEWER: There's always Shanshu (the ancient prophecy introduced during Angel's first season that says once a soulful vampire fulfills his destiny, he becomes human).
WHEDON: It's not quite that simple, although a lot of people have been making reference to that. But that's an interpretation, and ultimately could become the interpretation if we decide to go that way. I have some other ideas. The trick is how to bring him back without losing the integrity of what he did... the sacrifice. If it's just, "Hey, I'm back!" then that whole moment at the end of Buffy is kind of lame now. Like Buffy returning from the dead, it's going to be something that we're going to have to earn and play the ramifications of, possibly without making it so depressing.
If anything, there seems to have been a lot of uncertainty at the time about how Spike was to be brought back to life.