If SPI (or any other interface which depends on edges of some signal, usually clock) is to be operated at high speeds, its output pins' slew rate have to be selected to be appropriately higher. It may appear, that there's no reason to select any other than the highest-speed setting. However, there are reasons for not to do so.
The main reason is, that too "sharp" edges have a high high-frequency content, and the tracks carrying them behave as transmission lines. The practical consequence is, that unless the tracks are properly designed, and unless they are properly terminated, reflections may occur, which result in the singal "ringing" i.e. exhibits dampened oscillations after each transition. In protocols where data are shifted upon some clock edge, such as SPI, the receiver may be fast enough to react on such ringing as if they were multiple clock edges, resulting in corrupted data transmission.
There is a couple of secondary reasons, too: high slew rates i.e. frequencies emphasise errors and imperfections in ground/return design, further deteriorating the resilience of data link to external interferences; they result in excessive current consumption peaks thus noise in supply current and ground; in some STM32 they may require switching on the compensation cell which adjusts the output stage according to particular voltage and temperature, at the cost of somewhat increased power consumption.
Corollary is, that the GPIO slew rate has always to be selected with regard to the actual requirements, not slower but also not faster.