Spike went to the magic shop to find a love spell to get Buffy to accept her love for him. Later she stops denying. Anya wanted Spike to wish something bad to happen to Xander. It was only way she could get vengence on Xander
.
What BOTH intended to do in that scene and what ACTUALLY happened, are two different things.
Spike arrived at the shop looking for something to take away the pain of what he had done, he wasn't looking for a Love Potion or a Spell. He felt guilt at his attempted rape, he wanted to remove the remorse.
They didn't have sex to get revenge, they didn't know the cameras were watching them, and that Buffy and Xander would be tuned in at that exact time, they did it to find solace in each other.
As Xander found out if Spike had cast his spell would have had dire consequences. Xander didn't work the way intended because Cordy still loved him. Buffy was only burying how felt. The feelings were still there.
First you MUST mean Anya.
At this point Buffy HAD no feelings for Spike like that. She saw the Vampire, because all he had was a chip. She knew that the second he got rid of that BAM, he was back to the Evil guy he was. It wasn't until he achieved his soul, and the pain he was suffereing that Buffy started to feel true emotion for him.
Anya vengence spells weren't working because deep down she didn't want anything to happen to him. Her feelings for him was messing up spells cast on other men. Her buried feelings causing the spells to fail.
Again you could not be more wrong, you could try, but you would fail.
For a start, Anya's vengeance on Xander failed because she couldn't wish it herself, no one else did wish it, hence no retribution magically.
Her 'vengeance' came in a way she truly didn't intend. Spike was not planned, was NOT in her head any way to get revenge, she was lonely, out in the cold, Spike provided her with something for those few minutes.
AND the reason her spells we're not causing the desired effect, it wasn't Xander, it was her Human side. Her Humanity was still a big part of her, she didn't have it in her to cause death and destruction any more.
In Selfless you see she is capable of still causing the same amount of chaos, she just chooses not too, because of her humanity.