Do you mean in a bed? and do you mean they wake you up and they're right next to you? well if yes to both, then it is because you have placed your bed right next to a wall, so, the monsters can actually come in or can get you, i dunno why i think its a glitch.
Anyway try placing your bed one block away from the walls on all sides. hope this helps.