SPI only working for pins 10,11 and 13

I followed these two examples to get SPI working for a 12 bit DAC chip, using pins 10,11, and 13.

It works OK, but when I tried to redefine the SPI interface to use pins 7,6 and 5 it stopped working.

eg,

#define SLAVESELECT 5 // CS
#define DATAOUT 7 // DIN
#define SPICLOCK 6 // SCLK

Is there a reason that SPI only works on pins 10, 11 and 13 on the Arduino?

The ATmega8 / ATmega168 chip on the Arduino board has built-in hardware support for SPI, but only on pins 10, 11 and 13. To do SPI on other pins, you'd need to emulate it in software, which would require more complicated code (and would probably be less reliable).