Is it illegal for a lawyer to intentionally lose a case for the sake of justice?

The situation you describe would not exist in a real situation. The reason why you have this problem is because of your lack of knowledge and understanding of the role of lawyers and of the justice system.

One, lawyers do not decide whether a lawsuit is won or lost, it is the judge who decides whether a lawsuit is won or lost.

The core of the modern judicial system is the referee as the center, whether it is the western name of the "independence of the judiciary", or China's "people's court according to law, independent exercise of judicial power", have determined the referee is also the judge in the The central position of the litigation case. Whether it is the plaintiff or the defendant, whether it is the plaintiff's lawyer or the defendant's lawyer, whether it is the public prosecutor or the defender, no matter what is said in court, what is claimed, ultimately depends on the judge whether to adopt. Therefore, the lawsuit win or lose, its ultimate depends on the judge, not on the lawyer.

For criminal cases, lawyers can participate in court hearings as the defendant's defense attorney, as the victim's attorney, in most cases, the defendant will be sentenced to imprisonment, but the defense attorney's defense is a duty entrusted by the law, and all lawyers are dedicated to their duties.

second, according to the law, the lawyer's should be honest and trustworthy, diligent and responsible, based on the facts and the law, safeguard the legitimate rights and interests of the parties.

As you said in the title, the lawyer knows his client is wrong, committed a crime, that lawsuit lost, there is no lawyer intentionally lose the lawsuit, that is the client's own behavior leads to the result, not the lawyer intentionally will be the lawsuit lost. Need to know, the lawyer for the suspect, the defendant defense, can only be based on the facts and legal penalties, looking for evidence of the defendant's innocence, misdemeanor and legal basis for his defense. The lawyer cannot and will not make up a fact out to defend the accused.

It would be a dereliction of duty on the part of the lawyer if he knew that the defendant had circumstances of innocence or misdemeanor and did not go to his defense. If the defendant finds that his or her defense attorney has failed to do his or her duty, he or she can be released from the commissioned representation in accordance with the law and has the right to file a complaint with the attorney and the judicial authorities in accordance with the law.