Logic high preventing sleep mode STM32?
Take a look at the comment at the bottom of page 170 of the reference manual:


  Note:   An additional wakeup event is detected if the WKUP pins are enabled (by setting the EWUPx (x=1, 2, 3) bits) when the WKUP pin levels are already high