By dint of the fifth amendment to the Constitution, US citizens are protected from being forced to give self-incriminating testimony; pleading the fifth is a common refrain in many a courtroom. Jewish law goes one step further; it forbids the giving of self-incriminating evidence. Ein adam masshem aztmo rasha, a person cannot turn himself into an evil person (Yevamot 25b). Thus, one who admits to having killed someone cannot be convicted based on his own testimony. While we cannot convict based on self-incriminating evidence, may we accept his testimony regarding others? Or should we say that while we may not convict him, we also do not want to rely on evidence of a self-confessed murderer? This issue is the subject of debate of our Mishnah.
"[If one says] he died, I killed him or we killed him, he may not marry his wife [but others may]. Rabbi Yehuda says, [if he says] I killed him, [neither] he [nor others] may marry his wife" (Yevamot 25a).
Jewish law has greatly relaxed rules of testimony regarding the death of a husband: "In order to prevent agunot, the rabbis were lenient" (Yevamot 88a), accepting the testimony of a single witness, or that of a relative, or even circumstantial evidence, thus freeing the women to remarry. The Sages of our Mishnah teach that such testimony is accepted even when it is a result of someone confessing to murder of the husband. While the "murderer" may not marry the widow, other people may. Rav Yehuda disagrees, ruling that such a person is a rasha, evil, and the Torah warns, "Do not extend your hand with the wicked to be an unrighteous witness" (Shemot 23:1). We are not able to apply capital punishment, and we cannot rely on his testimony, even with regards to the freeing of an agunah. We just can't trust the wicked. This view is most understandable.
It is the view of the Sages--allowing a woman to marry based on the testimony of the man who claimed to kill her husband--that is most interesting. The Gemara debates whether this is a specific leniency regarding women or reflects the laws of testimony in general.
According to the former view, that of Rav Yosef, in principle the Sages agree with Rabbi Yehuda that one who admits to murder is an evil person who has no place in a witness box. However, "testimony of a woman is different", and regardless of the source, absent evidence of a lie, all testimony is accepted to free an agunah. However, if one, to use the Talmudic example, were to claim that "so and so sodomized me with my consent", we would ignore the testimony completely.
Rav Menashe has a different explanation. Even with regard to testimony that would allow a woman to remarry, we can only accept testimony from a (relatively) trustworthy source. So unlike other areas of the law, we will gladly accept the testimony of a relative or even of only one witness. We will even accept the testimony of "a thief according to rabbinical law", such as a gambler, to permit an agunah to remarry. But one who is known to be a "thief according to the Torah" would have his testimony rejected in all matters, including pertaining to a woman and remarriage.
However, in our particular case, the only evidence of wickedness is his own testimony, "I killed him". In this case, we must invoke the rule that "a person is close to himself, and one cannot establish himself as a sinner". We may not accept a person's testimony identifying himself as an evil murderer. But insofar as that testimony relates to others, we can accept it--as, absent evidence from other sources of his wrongdoing, he is still a valid witness. So if one says "I killed so and so", we disregard the claim as it pertains to murder, but accept the claim that the husband is dead.
This concept, known as palginun dibura ("we split his words"), is a fascinating (and somewhat difficult) idea that has been adopted by secular law, with its distinction between evidence needed to convict in a criminal case and as opposed to a civil one. In the former, we can only convict if we are assured "beyond a reasonable doubt" of one's guilt; whereas in a civil suit, all that is needed is "preponderance of the evidence". Thus, the exact same testimony may assign guilt and a monetary payment, but be unable to get a criminal conviction.
Only G-d is the bearer of ultimate truth. Man must live with the inherent contradictions that abound.
 Unlike most secular systems of law, Jewish law only accepts testimony from people of fine character. The idea of making a plea-bargain with a criminal is foreign to the Jewish way of thinking. We must assume that one who commits criminal acts is very likely to lie, especially if there is personal benefit involved.
 Generally, a gambler's testimony is not accepted in a court of law (Sanhedrin 24b). His winnings may be considered a (rabbinic) form of theft as, while they were won fair and square, they are given most reluctantly, and accepting such is a form of theft.
 Interestingly, this principle only applies in criminal law, but in matters of civil law "the admission [of guilt] of a litigant is equivalent to one hundred witnesses" (Gittin 40b). Perhaps the difference lies in the fact that one does not own one's body and thus, may not cause oneself to be convicted of a capital offence. However, we do own our money and can do with it as we please, including using the court system to give it away.