Hello mimco,
You cannot directly connect the SPI pins of two MCUs operating at different supply voltages.
Where a 5 volt output connects to a 3V input the voltage swing at the input must be limited by one of a number of possible methods, so as not cause damage to the 3V device. Where a 3V output connects to a 5V input, is is quite possible there will be insufficient voltage swing to reliably switch the 5V device. In this case the voltage swing will need to be boosted to meet the requirements of the 5V input.
You do not specify which device is the SPI master. The master has three outputs and a single input, whereas the slave has three inputs and a single output.
Special buffer devices are available for voltage translation purposes, with some capable of bi-directional operation. Alternatively, for high-to-low voltage translation, a simple resistive voltage divider may suffice. Yet another possibility is to use MOSFETs as inverters. The MOSFET must reliably switch at less than 3 volts, a relatively low value pull-up resistor (perhaps 1k to 4k7) will be required at the drain, and the logic inversion will also need to be taken into account.
It two separate power sources are used for each MCU, it is also possible for only one source to be present, and the other switched off. Under these circumstances, the buffering method must also ensure that excessive current cannot flow in any of the interconnections - perhaps not exceeding 0.2 mA.
Regards,
Mac