I've had this issue ever since upgrading from Yosemite to El Capitan 10.11.5 on my iMac 21.5" late 2012.
My hard drive is on "never sleep" (have to keep it up - linked to video surveillance) and the passworded screen sleep set on 3 minutes or so.
The Mac would work fine until wanting to wake it up... the blue screen with the password window appeared, let me key in my password, dimmed right away and... the spinning color wheel appeared ... with it the freeze ! The freeze occurred totally randomly but at least once or twice in a 24 hours period.
Restarted it each time using the power button to force quit and restart.
Read many forums and proposed solutions, applied some (including setting hibernation to OFF) updated to OS X 10.11.6, tried and tested for the past 3-4 weeks with no results. I even reinstalled Mac OS X 10.11.6 ...all this didn't help until... until I decided to switched off TimeMachine (enter TM preferences and slide the switch from YES to to NO).
Strangely enough this did the trick for me. After two days of no issue, I switched "ON" TM again to test and the freeze on wake issue started again within hours. Switched OFF again and all was fine !
No alert whatsoever from TM on a possible malfunction during all that time. I am backing up on my Sinology and back ups record just fine.
Until the next OS X update I'll just have to manually switch on and off TM to perform backups. Not ideal but this'll do for now.