I used to sail, obviously nothing like the size and luxury of the Bayesian but the principles remain the same.
One or more of crew will have been (or at least should have been) on deck throughout the night on 'storm watch'. That's standard practice, even in harbour, when poor weather is forecast, which it was. The point of this is so that someone has eyes on the weather and the vessel at all times and can, if necessary, raise the alarm to get to a muster station and/or take action if it gets really bad or if there are problems such as dragging anchor.
I suspect there were also crew already working at that time, or at least getting ready to work.
My understanding (which may be very wrong) is that the yacht went down very quickly - a minute or so. It's easier to get off a vessel when you're already awake and ideally on deck than it is if you're asleep below deck. That will be why all but one of the crew survived while the others were less lucky.
It's impossible for us to know yet if more could or should have been done to save lives or if any major mistakes were made. The authorities likely already have a few ideas. There's been speculation that hatches were left open because it was hot. I'd be hugely surprised if a yacht of that calibre didn't have air conditioning (I've been on a much shitter yacht with Aircon) so who knows what was going on there; that's why there's an investigation. As a very amateurish sailor there's a few things I've wondered about but it's not helpful to speculate. I'm sure the authorities will look into things properly.
But in short, I suspect the crew bar one survived because they were a) awake and b) weren't in their cabins.
The whole thing is terribly sad and shocking. The Med, just off the coast, in August is usually an incredibly safe and very straightforward place to sail. It's a reminder of how fickle nature can be and how dangerous even "safe" bodies of water are.