I had a similar event pop up in curse of strahd with the vampires in a certain building in one of the towns (I don't wish to spoil). The players found them during the day and opted to nail shut two boxes and stake the rest simultaneously. I ruled a stealth check vs their perceptions to do said nailing and made then each roll agains their ac (granting players advantage) with the stakes. In the case of those monsters, they instantly die if staked as it says in the statblock, though had they been guards I would have made their attacks with advantage and critical hits as per the unconscious condition. I do in fact rule that creatures can hear while sleeping, though I will typically give them disadvantage on their perception checks (or more accurately a -5 to passive perceptions).
I don't do instant kills for a couple reasons:
1) Anything the players do is fair game to do to my players. They know this and would rather the ocassional assassination attempt go slightly awry then have half the party murdered in their sleep by enemy assassins.
2) Anyone that should reasonably be one shotted in their sleep is typically low level mooks/guards, meaning they a) won't have much HP in the first place, and anyone who archetypically would regularly be doing assassinations without setting off alarms is usually going to be a rogue, and thus have sneak attack (which I remind you is also effected by the critical of attacking someone sleeping). Targets who are higher level might still survive the first attack, at which point combat ensues as normal, but maybe they shouldn't have tried to kill the barbarian warlord king in his sleep alone? I typically will give players ample telegraphs about the "strength" of their target in such cases, or fair warning ahead of time that their would be target is a paranoid type (sets traps, guards outside the door, etc).
I should note though, all of that is entirely contingent on the genre of game I'm running. Am I running a heroic fantasy? Yes, I'm ruling as above. Am I running a gritty game of thrones esque survival game? Likely having instant kill options. Options I WILL use on players as well.