Spike's presence in the battle against Glory was irrelevant, so Riley could have easily taken his place. Who knows, he might have defeated Doc? That is pure speculation, though. Admittedly, he could have hardly done worse against Doc. And without Spike around, they might well have got transport that wasn't an RV that was slower than horses, perhaps stopping Dawn from being captured in the first place.
As
@famicommander states, that is one way the endgame could have happened, and perhaps the one that requires the fewest changes, but things before then would have changed, with unknown knock-on effects. Without Spike around to abuse Buffy, she could have healed much faster from being pulled out of heaven. Certainly, her lousy choices related to Spike in S7 would not have happened, and without his abuse constantly dragging her down, she may well have come up with a much better plan than the one that would have got everyone killed if not for W&H. With Riley still around, it is much more likely that the Initiative could have been called in and, as I mentioned elsewhere, Sunnydale could have been nuked from orbit. Because that is the only way to be sure.