What I don't get is how that is legal for regular employees.
Long, drasting overtimes are something that sorta comes with working in the gaming industry. If you can't accept that, don't work in that field.
Speaking from experience, it's not as easy as most people view it. Often, you can't just delay the game – there can be very severe contractual obligations preventing you from doing that, or you know that the cost of the delay would be so massive (not just in development costs, but of course marketing costs if you've already launched a marketing campaign, plus there are certain periods in the year when you want to release a game and when you don't in order to maximize revenue). So you get hard deadlines that just cannot be moved, meaning the game is coming out on that date no matter what. But then the usual happens and the thing is taking longer than planned (something commonplace in software development in general) and you realize "if I release the game in this state, it'll fucking bomb". And you can't afford to let the game bomb – a big budget game tanking can bankrupt a smaller studio, and can slash everyone's salary even with large studios. After all, if the game bombs, the company isn't going to get any income save that from sales of its older games (if it has any, and if people are still buying them, which is not certain at all and drops over time). So what happens is the studio owner or whoever's in charge there calls everyone together and gives a heartfelt talk basically begging everyone to do anything and everything in their power to fix the game up for release. And they do – not only does the success affect their future pay, but they also genuinely want the game to succeed. People who don't care about the game's success usually don't last very long – if they don't put in overtime and leave their work unfinished, there's often nobody available who could do it for them. So they do that once, then are never given important work again, and then are let go since the company literally cannot afford to have such people on-board (at least in the development team. HR, marketing, etc. are a different matter entirely, of course). And that's how you get people working past midnight and sleeping in the office for week or two (more than that tends to lead to burnouts) before release.