Why does a 32 bit microcontroller has only 16 pins in each port
STM32's port definition allow only 16 pins/port, because they re-use the upper 16 bits. 

Look at how the BRR and BSRR registers work - the upper 16 bits have a complemantary function.