I'll admit, I always thought Batman: The Dark Knight Returns was kind of overrated. At the very least, I don't should have had the impact it did, given how many people look to it as the definitive Batman story and an example of how he should be written. Outside of his Daredevil run, I really feel Frank Miller should have just stuck to Sin City.
As far as Batman's code against killing goes, I'm very much in favor of it. To me, superheroes are tolerated primarily because they work as much within the law as possible, apprehending criminals with appropriate force and dealing with problems that are beyond the scope of normal law enforcement. Superheroes are embraced because they save lives, stop threats, and when they've dealt with a criminal, they turn them over to the proper authorities to let the legal system deal with them.
The reason cops are allowed to use lethal force against criminals is because they are normal people armed with the only weapons available to them, and even then there is a very small number of circumstances that give them the right to respond with lethal force. And every use of lethal force is investigated to make sure the cop was acting appropriately.
Superheroes are often men and women with skills, weapons and abilities beyond that of normal people, and have options beyond lethal force to subdue a target. And even then, I feel they're justified in killing if it's a "kill or be killed" scenario where they have no other options. If Batman was in a fight with the Joker and the only way he could save his own life or the life of someone else was to kill the Joker in the heat of battle, I don't think anyone could complain.
If Batman has the Joker defeated and subdued, has him completely restrained and ready to turn into the police, and then he kills the Joker? That's murder. If the Joker is not an immediate threat, if he's restrained and defeated, Batman killing him would be murder, period. At that point, he has decided to take it upon himself who lives and who dies, making him literally judge, jury and executioner. At that point, he has lost his objectivity and would probably turn himself over to be imprisoned.
Batman stops the Joker and turns himself over to the police. After that, it's up to the legal system to deal with the Joker appropriately. If it's anyone's fault that the Joker is still a menace, it's the courts that don't simply put him to death or ask Superman to put him into the Phantom Zone.
Granted, its part of the reason why I feel Batman works better when he actually, you know, prevents the Joker from killing people, otherwise the Gotham City legal system looks REALLY bad for not killing him. As it stands, in the case of most cartoons and comics, Batman stops the Joker before he harms too many people. Which is how it should be.
A major point of the whole Knightfall Saga was to examine whether or not the concept of Batman was better served by Bruce Wayne or by 90's Anti-Hero Azreal, and the ultimately conclusion the writers and fans came to was that Bruce Wayne was the one true Batman.