sine wave using SPI

Start by replacing the digitalWrite's for the slaveselectPin with direct port writes:
Say the pin in use is Port B, pin 2

PORTB = PORTB & B11111011;  // pin2 low
SPI.transers
PORTB = PORTB | B00000100;  // pin2 high

that will help a lot