Hi,Carles,
As David said that It is strange that the MOSI pin can not pull to LOW logic, pls check if the pin is connected to a diode, your phenomenon seems that the pin is connected to a diode or the pin is damaged.
The SPIx_OUT(MOSI) is a push-pull pin if you clear the ODE bit in corresponding PORTx_PCRn register, even if you set the pin in open drain mode, it means that the High logic can not reach if you do not enable pull-up resistor.
Hope it can help you.
BR
XiangJun Rong