If the laptop is powered on and the screen gets closed, the laptop should sleep, unless an external monitor and keyboard is connected to it.
I've had a few applications (Evernote being one of them from time to time) that prevents my rMBP from sleeping. Maybe there's something related?