Sure, you can use GPIO pins to "bit-bang" any protocol you like (subject to performance limits) - but that requires you to code every single rising edge, delay, falling edge, and sample in code.
That's very heavy on you writing the code, and on the processor having to run it.
Therefore microcontrollers have dedicated hardware blocks for doing common things like SPI, I2C, UART, etc
That relieves both you of having to write, and the processor of having to execute, all that tedious bit-twiddling - you can just pass data to the SPI unit, and it handles it all in hardware.
And hardware can give much higher performance than "manually" twiddling bits by software.
This is general across all microcontrollers - not specific to ST or STM32
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.