I've already said this a while ago in another thread, but Supes vs the Elite (or the comic equivalent) is a much better example as to why heroes shouldn't kill compared to Batman's speech in Under the Red Hood. When a hero starts to go off the rails, people are afraid, ND at that point why would they be a hero?
I always took Batman speech in Under the Red Hood as talking more about himself than heroes in general. That HE would never come back from that. That HE wouldn't know where the line is anymore and he wouldn't know how to stop. It's acknowledgment that he doesn't have the capability to walk the fine line or come back from that.
Plus, the difference between what Batman is up against and what Superman is, are their archenemies. Joker and Luthor represent philosophical debates to what Batman and Superman truly represent. For Batman, his stance is that we have to act outside of social norms because the world isn't perfect but that doesn't mean that those norms are unimportant. Joker says that the fact that random injustice happens, means that there is no justice. That you can destroy innocence, means that there is no innocence. Hence, your life is a joke. So when Joker commits his crimes, he's constantly escalating because he's trying to push Batman in to compromising his codes, his morals and thus, proving Joker right. The fact that Batman acknowledges that if he kills, he turns into the same as the criminals he stops and punishes, is a show of self-awareness. Batman is a dichotomy. He is a product of a need for vengeance against the criminal element and injustice that took away his parents and shattered his innocence. It's also part of the reason he's such a control freak, because he doesn't want to feel helpless again. Moreover, he blames himself for not stopping his parent's death, even though it wasn't his fault. He tries so hard, because he doesn't want to fail anyone else. Batman is ultimately a compassionate individual who wants to prevent that same harm from happening to others due to the malefactors in our imperfect world. He has taken his rage and his anger and has funneled them down a positive path for the benefit of both himself and others. So, he's already walking a fine line to not allow his need to punish criminals override his humanity and noble aspirations. If he takes a life, becoming judge, jury and executioner, then he has gone over the edge and has become like the criminals: putting his own wants and needs first at the expense of others. He becomes the very thing that took away his parents.
With Superman, Luthor represents the opposite of what Superman is. Superman and Lex represent the two measuring sticks society looks at in people. Superman presents the inner strength that society says we should have. The strength to be compassionate, kind and help lift others up so they can help lift you as well. Lex represents the outer strength that society says you could have. The strength to be ambitious and to succeed in spite of the odds arrayed against you. He's a powerful businessman and one of the most intelligent people on the planet. He's seen and done more than most ever will. But, this has come at the cost of Lex's soul. He is more monster than man. He will exploit anyone and anything to get what he wants, which is everything. There is a void in Lex that can never be filled because he has failed to work on turning himself into a better person. His sense of self is brittle, ultimately. This show in the fact that Lex pushes others down to raise himself up, even though he doesn't actually need to. His level of intelligence and drive put him into a different category than your average Joe. Instead of realizing how much that drags him down, he enjoys that. He enjoys toying with people, lording his gifts and accomplishments over them. Lex represents the greedy, petty, and self-serving nature of humanity that Superman fights against. Even if Superman killed Lex, that wouldn't change anything because Superman's true enemy is the corruption that Lex embodies. Someone else would just rise to take over where Lex started. Killing Luthor doesn't solve the problem, it just gets rid of the current face of it. Superman is there to show that there is a better way. That you don't have to be like Lex in order to achieve great things or just simple happiness. He wants to inspire people so that, together, we can all achieve the things Lex has but without sacrificing each other and what makes us people. The hope for a better world that we all can live into together in happiness and achieve greatness for everyone.
At least, that's how I've always looked at things.
Made some edits to flesh out my thoughts.