What a nasty habit of encoding something into constant and not leaving any comment about what this constant means. You are lazy to write comments, I will be lazy to help you next time, ok? I mean this:
SPICR1 = 0xD2;
Do you think everyone remembers the name and position of each SPICR1 bit???
Decrypting your SPICR1 setting means SPIE=1, SPE=1, MSTR=1, SSOE=1.
You enabled SPI interrupts (SPIE), but where's your interrupt handler?
As Bigmac said, automatic SS function should be disabled, SS pin should be set and cleared manually. So SSOE should be 0.
SPICR2 = 0x10;
MODFEN bit should be also off.
val = SPISR;
if(val == SPTEF)
break;
SPISR may have more than one bits set, not just SPTEF. BTW how is SPTEF defined, is it constant 0x20? If so then red line should be changed to if(val & SPTEF)
val = SPISR;
if(val == SPIF)
break;
Same here, if(val & SPIF)