It's difficult for a video game developer to keep secrets about their protagonist from players. Because they're usually in control of them for the entire runtime (as well as sometimes being capable of tailoring their actions to their own choosing), gaming heroes are more often than not open books.
That only makes it even more satisfying when devs manage to trick players into believing they're playing as the good guy - the righteous hero of the story - only to reveal later that they've been a right evil bastard.
Gamers don't usually question what they're told; if it's been stated that the hundreds of goons they're killing are villains, it's more than enough justification to murder them as brutally as possible for the next ten hours.
Taking that trust and smashing it into a million pieces, thanks to some cheeky narrative tricks that convey the unreliable perspective of these main characters, there's nothing quite like realising the hero you've been playing as has been the big bad the whole time.