It becomes part of the plot that Ellie is not needed alive. After rescuing Ellie and nearly escaping, she is shot in Joel's arms. She dies exactly as his daughter did. Afterward, the player is free to choose whether to walk away, or kill Marlene.
The ending scene is Joel sitting in his room, silently looking out his window. After about 10 seconds of complete silence it fades to black.