AVR IO Alternative Functions Priority
The "Alternate Port Functions" subsection of the "I/O-Ports" section of the datasheet describes exactly how each pin will behave given the peripherals enabled. In the case of SPI, only either MISO (master) or the other three pins (slave) are forced to a specific direction (input in both cases); the other pins can have their direction configured to either conform to SPI or not as required/desired.

Note that DDRx, PORTx, and PINx can always be read from and written to regardless of the current functions of the corresponding pins, even if such an action does not make sense given their configuration.