Arguments rage in the Buffyverse, even now that the show is no longer on the air--Is it Buffy and Angel 4ever? Did Buffy ever really love Spike? Did Willow pay a deep enough price for her Dark Willowiness? Was Spike redeemed only after he got his soul? From what I've seen and read--and I admit there's much I've neither seen nor read--Joss Whedon and the writers would answer, 'no,' to this latter question. Spike was still evil before he got his soul back, he just couldn't act on his evilness.
Now, if the writers say it's so, it's so--or at least they intended that it be so. But let me see if I can explain why I--and, I think, a lot of other viewers--thought that what actually played out in front of us on-screen told us a different story.
In his book, Good Business, author Mihaly Csikszentmihalyi, says this about soul:
Perhaps the best way to explain what the word "soul" connotes is that, no matter how complex a system is, we judge it as having no soul if all its energies are devoted merely to keeping itself alive and growing. We attribute soul to those entities that use some portion of their energy not only for their own sake, but to make contact with other beings and to care for them.
This definition actually works pretty well in the Buffyverse.
Angel--cared about people; had a soul
Angelus--cared about nothing; had no soul
Vampires in general--care about nothing except their next meal and a little violence
You can apply these criteria to the humans, and the ex-demon, Anya, as well.
When Anya was a demon, she didn't care about anything except vengence. When she first become human, she didn't care about much except getting her powers back and staying alive. But then, she started to care about Xander. Gradually, though she didn't always like it, she started to care about Xander's friends and even about saving the world. When Xander dumped her at their wedding and she got her vengence demon-ness back, she was a lousy vengence demon because she wasn't willing to give up her soul.
Willow was all about soul through the first five and a half (okay, maybe the first five) seasons. She cared about the world, she cared about her friends, she was brave and smart and her career choice when she graduated from high school was to help save the world. But she put her soul in danger when she started to care more about power than about her friends (though she fooled herself into thinking it was about them). And she lost it entirely when Tara was killed. She didn't care about anything then except destroying the world. She got her soul back because Xander cared about her.
Spike cared about Drusilla right from the start. He cared about Dawn, and a little bit about Joyce, in season five, though he didn't really want to and I don't think he liked it much. He thought he cared about Buffy, but he didn't until maybe the end of season five or possibly the beginning of season six. By then, I think he did care about her (though it was also very mixed up with the things Spike didn't know much about--like being human--and with obsession and sex and violence).
So, by my reckoning, Spike already had his soul when he went to Africa, though I'm not sure he knew it. I think the demon gave him what he wanted, sort of like the Wizard gave the scarecrow and the tin man and the cowardly lion the things they wanted--things they already had, but hadn't realized yet.