סימן קפא סעיף כב
שְׁנֵי עֵדִים, שֶׁאֶחָד יוֹדֵעַ בַּחֲבֵרוֹ שֶׁהוּא רָשָׁע וּפָסוּל לְעֵדוּת מִן הַתּוֹרָה וְאֵין הַדַּיָנִים מַכִּירִים בְּרִשְׁעוֹ, אָסור לוֹ לְהָעִיד עִמּוֹ, אַף עַל פִּי שֶׁהִיא עֵדוּת אֱמֶת, שֶׁנֶּאֱמַר, אַל תָּשֶׁת יָדְךָ עִם רָשָׁע לִהְיוֹת עֵד חָמָס. וּגְזֵרַת הַכָּתוּב הִיא, שֶׁכָּל הָעֵדוּת בְּטֵלָה, אֲפִלּוּ הֵם רַבִּים, אִם אֶחָד בֵּינֵיהֶם פָּסוּל. וְאֵיזֶהוּ רָשָׁע שֶׁפָּסוּל לְעֵדוּת מִן הַתּוֹרָה. כֹּל שֶׁעָבַר עַל דָּבָר שֶׁפָּשַט בְּיִשְֹרָאֵל שֶׁהוּא עֲבֵרָה, וְהוּא דָבָר שֶׁבְּלֹא תַעֲשֶה מִן הַתּוֹרָה, וְעָבַר בְּזָדוֹן וְלֹא עָשָׂה תְשׁוּבָה. אֲבָל אִם יֵשׁ לִתְלוֹת שֶׁעָשָֹה בִשְׁגָגָה אוֹ בְטָעוּת, שֶׁלֹּא יָדַע אֶת הָאִסּוּר, לֹא נִפְסָל לְעֵדוּת.
If there are two witnesses and one of them knows that the other is a sinful man, and is not qualified to testify according to the law of the Torah, and the judges are unaware of his wickedness, it is forbidden to testify with him, even though the testimony is true, for it is said: "Do not join your hand with a wicked man to be a corrupt witness.18Exodus 23:1. It is a Divine decree that the entire testimony be invalidated even if there are many witnesses, should one of them be disqualified to testify. Who is considered sinful enough to be disqualified as a witness by decree of the Torah? Whoever transgresses in a matter which has been accepted by the Jewish people as a sin, and which is a Divine prohibition, that he violated intentionally and has not (been known to have) repented. However, if it is possible to assume that he did it unintentionally, or in ignorance, not being aware of the prohibition, he is not disqualified to bear testimony.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)