The last scene of the Dark Knight includes a dialogue between James Gordon and Batman about pinning onto Batman the implied murders committed by Harvey Dent.
No one has this knowledge other than Gordon and Batman. Still these deaths needed to be accounted for. They weren't going to pin it on Harvey because of what he represented and how damaging it would be if the truth was out.
But why Batman? Chronologically, it could have been the Joker. And it wouldn't be out of character for the Joker.