See, bittersweet works. But if Braveheart had ended with Wallace being torn to bits and the Scots being conquered and oppressed for a hundred years, people would've complained. If the end of Gladiator had seen Russel Crowe get beaten down by Emperor Toilet, and all of his buddies fed to lions for their culpability, it would not have been popular.
Plus, Will Smith's all about 'Hope' and 'Fun.' People expect, if not a happy ending, a hopeful one.
Dawn of the Dead works because it's an outright horror film. I Am Legend was billed as something different - a character piece, or a survivor's tale. Not enough people go to horror movies, especially not around Christmas. You want the big bucks, you can't make it a pure tragedy.