@lfost
If you're not using one of the SPI pin functions, you don't need to assign a pin to the function.
That's the easiest solution (with the next easiest one putting a pull up on it or tying the pin to GND the way you have) otherwise you'll probably see delays and other weirdness.