I'm paraphrasing here, but a wise man once said "an immature man dies nobly for a cause. A mature man lives humbly for one." In TDKR, Bruce Wayne is prepared to die to save Gotham. But then he matures.
I feel if he kept fighting or died it would have left his character unchanged, which is usually considered to be an element of bad storytelling.