I don't know if my question is philosophy, law, history, ethics
Many questions about ethics are on topic for Law SE. That is because ethics is very often part of, and/or inseparable from, legislation and other sources of law. This is palpable in the examples that follow. Sometimes ethics is even mandated by the law.
Iberiabank v. Broussard, 907 F.3d 826, 840 (2018) points out that "Louisiana courts permit LUTPA claims based on breaches of ethical standards even if there are parallel remedies for similar conduct" (emphasis added, citations and quotation marks omitted).
Ethics is supposed to be one criterion for rulings on equitable grounds. As an example, Matter of Mobile Steel Co., 563 F.2d 692, 699 (1977) states that bankruptcy courts "possess the power 'to prevent the consummation of a course of conduct by [a] claimant which . . . would be fraudulent or otherwise inequitable' by subordinating his claims to the ethically superior claims asserted by other creditors" (emphasis added, quotation marks in original, citations omitted).
MCL 15.486 provides that the Regulatory Boards and Commissions Ethics Act "is intended to supplement existing ethics law, and if there is a conflict, the following laws prevail" (citing statutes).
MCL 124.754(9) reads that "[a]n authority shall adopt a code of ethics".
Various rules and comments in the California Rules of Professional Conduct make several, explicit references to the California Code of Judicial Ethics and "an applicable code of judicial ethics".
The court in Florida Bar v. Went For It, Inc., 515 U.S. 618, 645 (1995) alleges that "[t]he objective of the profession is to ensure that 'the ethical standards of lawyers are linked to the service and protection of clients'" (citations omitted, quotation marks in original).
the criminal only had evil intention but in fact he saved the life of the victim. Would that even change a verdict or the ethical conclusion what was the right thing to do?
No. It is important to distinguish between matters of ethics and random coincidences where a criminal's act unexpectedly prevented the victim from suffering greater harm. The criminal cannot reasonably posit that considerations of ethics should be a mitigating factor or lead to his exoneration for harm he actually caused.