Most 8, 16 and 32 bit microcontrollers execute the program directly from flash. This is true of the STM32F103 range. Most microcontrollers are capable of executing the program from RAM, but only relatively specialised programs actually do this. For this reason, most microcontrollers have far more flash than RAM.
There are some microcontrollers that have lots of RAM and little or even no flash. It may even be possible to get an STM32 like this. These parts rely on storing the program off-chip in a physically small and cheap serial flash chip such as a Micron MT25Q.
True microprocessors (where the RAM and flash is in separate IC's, such as the ARM 7 and similar parts) can and often do copy the program from flash into RAM and execute it from RAM. The main reason for this is that RAM is usually much faster to access compared to flash, so the program will run faster. Fast processors often run the Linux operating system which usually works this way. It also gives Linux the ability to store the program in other types of storage memory, such as SD cards and serial interface flash (serial flash).
Linux can be made to execute the program directly from flash (it is termed Execute-in-place) but this usually suffers a performance penalty.