Is it okay to be a defense attorney according to Jewish Law?
(ז) מִדְּבַר־שֶׁ֖קֶר תִּרְחָ֑ק וְנָקִ֤י וְצַדִּיק֙ אַֽל־תַּהֲרֹ֔ג כִּ֥י לֹא־אַצְדִּ֖יק רָשָֽׁע׃
(7) Keep thee far from a false matter; and the innocent and righteous slay thou not; for I will not justify the wicked.
(יא) לֹ֖א תִּגְנֹ֑בוּ וְלֹא־תְכַחֲשׁ֥וּ וְלֹֽא־תְשַׁקְּר֖וּ אִ֥ישׁ בַּעֲמִיתֽוֹ׃
(11) Ye shall not steal; neither shall ye deal falsely, nor lie one to another.
(כ) צֶ֥דֶק צֶ֖דֶק תִּרְדֹּ֑ף לְמַ֤עַן תִּֽחְיֶה֙ וְיָרַשְׁתָּ֣ אֶת־הָאָ֔רֶץ אֲשֶׁר־יְהוָ֥ה אֱלֹהֶ֖יךָ נֹתֵ֥ן לָֽךְ׃ (ס)
(20) Justice, justice shalt thou follow, that thou mayest live, and inherit the land which the LORD thy God giveth thee.

Niddah 61a

לא מבעי מיחש ליה מבעיהנהו בני גלילא דנפק עלייהו קלא דקטול נפשא אתו לקמיה דרבי

טרפון אמרו ליהלטמרינן מר אמר להו היכי נעביד אי לא אטמרינכו חזו יתייכו אטמרינכו הא אמור רבנן האי לישנא בישא אע"ג דלקבולי לא מבעי מיחש ליה מבעי זילו אתון טמרו נפשייכו

Summary: It was rumored about certain Galileans that they killed a person. They came to Rabbi Tarfon and said to him, "hide us." Rabbi Tarfon replied, "What shall I do? If I do not hide you, you will be seen. Should I hide you? The Chachamim have said that rumors, even though they may not be accepted, nevertheless, should not be dismissed. Go and hide yourselves

Tosafot Niddah 61a

אטמרינכו הא אמור רבנן האי לישנא בישא כו'. פי' בקונטרס ושמא הרגתם ואסור להצילכם ובשאלתות דרב אחאי מפרש שמא הרגתם ואם אטמין אתכם חייבתם ראשי למלך והיינו מיחש מיבעי ליה למיחש שיש לחוש ללשון הרע להאמינו לגבי זה שיזהר שלא יבא לו הפסד ולא לאחרים:

1) Tosafot quotes Rashi saying that Rashi thinks that from the last source we see that it is not okay to assist someone committed of a crime

2) Tosafot says that the reason Rabbi Tarfon would not help them was because he was afraid that the government would punish him for helping criminals escape, but that helping them is okay. From this he says we can learn: any help that the Government allows is okay, unless it is dangerous to the provider.

Opinion on Tosafot/Rashi #1:

Rabbi Shlomo Luria (Chochmat Shlomo) argues that this ruling of Tosafot and Rabbenu Asher only applies in cases where, in the aider's mind, the guilt of the defendant is in doubt, as it was in the Rabbi Tarfon case of known guilt, no help is permitted.

Opinion on Tosafot/Rashi #2:

Rabbi Hershel Shachter says: if a lawyer knows that his client committed a crime it is forbidden for him to help the criminal escaped the consequences of his act, by relying on some technical legal points or other devices. The lawyer, just as and Jew, is directed by the torah to “eradicate the evil from our midst,” and may not actively assist someone to avoid his punishment.

From this we learn: a lawyer cannot advance at trial a defense of "my client did not commit the crime" when the client has informed his lawyer that he did.

2nd Approach:

Rabbi Yaakov Ettlinger (and many others) say: In my opinion one could state that Rashi does not disagree with She'iltot (who agrees with Tasfot in the last source). When Rashi states that it is prohibited to save the murderers, he does not mean that it is prohibited according to Jewish law to save them, but rather that secular law prohibits that conduct. Once secular law prohibits this conduct, Jewish law does also, since saving these individuals would involve great risk with the law.

1st Approach:

American Adversarial System of Justice:

While a lawyer may not lie on behalf of his client, he must defend his client zealously, even if he knows the case against his client is factually correct.

From this we can learn: Protecting the client's constitutional rights is indeed pursuing justice, even though the end result is that a guilty client will not be punished for his crimes.

Conclusion:

Some opinions say its not okay in certain cases:

1- in cases where, in the aider's mind the guilt of the defendant is in doubt, as it was in the Rabbi Tarfon case of known guilt, no help is permitted.

2- a lawyer cannot advance at trial a defense of "my client did not commit the crime" when the client has informed his lawyer that he did.

Other Opinions have completely different thoughts in general:

1- a strong defense is proper for all, and the Jewish tradition allows for every defense technique permitted by the criminal justice system.

Another view essentially says guilty people have to be punished by society, and it violates Jewish law to defend them

Even those who permit religious Jews to practice law admit that, "there are ... limitations upon what a religious Jew may do." It seems that the inherent problems in the practice of criminal defense are unbeatable in many instances. A Jew who wishes to practice law within the boundaries of Jewish Law should conduct a lot of research before deciding to pursue the profession.