The Shulhan Aruch, in Hoshen Mishpat (Siman 34), discusses the qualifications required by Halacha for somebody to be eligible to serve as an "Ed," a witness. These guidelines are critically important in several different contexts, including testimony before a Bet Din that the defendant owes the plaintiff money, and the required witnesses who sign on a Ketuba or are present at the Kiddushin in a wedding ceremony. A person is not valid for these purposes if he does not meet certain qualifications.
The Shulhan Aruch writes that a person who has the formal status of a "Rasha" ("wicked person") is not qualified to serve as a witness. He defines the term "Rasha" for the purposes of this Halacha as somebody who intentionally transgressed a Torah violation that is punishable by either Malkot (lashes), death, or Karet (eternal spiritual excision). A violator obtains this status regardless of whether he transgressed "Le’hach’is" – with the specific intent to anger the Almighty – or "Le’te’abon" – because he could not restrain his evil inclination. This Halacha is inferred from the Torah’s use of the term "Rasha" in the context of a person liable to Malkot ("Ve’haya Im Bin Hakot Ha’rasha" – Debarim 25:2). If a violator of a prohibition punishable by Malkot is considered a "Rasha," then certainly violators of capital offenses obtain this status. Hence, one who willfully violates a prohibition that is punishable by Malkot, death or Karet has the formal Halachic status of a "Rasha" and is thus disqualified from serving as a witness.
This does not apply to a person who willfully neglected a Misvat Aseh (an affirmative command), such as if somebody did not take a Lulab or eat in the Sukka on Sukkot. Neglecting a Misvat Aseh is not punishable by Bet Din, and therefore it does not render a violator a "Rasha."
The Aruch Ha’shulhan (Rabbi Yechiel Michel Epstein, (1829-1908), in his Aruch Ha’shulhan (Hoshen Mishpat 34:5), writes that a person is also disqualified from serving as a witness if he strikes his fellow. We read in the Book of Shemot (2:13) that when Moshe confronted the two quarreling Israelite slaves, he approached the "Rasha" to reprimand him for striking the other. This demonstrates that striking another person also places one under the category of "Rasha." As such, one who commits such a crime is ineligible to serve as a witness.
However, the Aruch Ha’shulhan claims that this disqualification applies only Mi’de’rabbanan – meaning, on the level of Rabbinic enactment. According to Torah law, one who commits the offense of striking his fellow is nevertheless eligible to serve as a witness, but the Sages enacted a provision disqualifying such a person. The reason the person remains eligible according to Torah law, the Aruch Ha’shulhan explains, is that he is not liable to Malkot for such an offense. There is a Halachic principle exempting a violator from Malkot if his violation makes him liable to pay money, and one who causes physical damage to his fellow must pay monetary compensation and therefore does not receive Malkot. As such, if not for the Rabbinic enactment, such a violator would not be disqualified from serving as a witness.
Others disagree, and claim that this disqualification applies even on the level of Torah law. In a case where a person causes his fellow less than a "Peruta"-worth of damage by striking him, he is indeed liable to Malkot, since there is no payment involved. Therefore, the crime of striking another person is considered a Malkot-level violation, even though in most cases Malkot are not actually administered. As such, according to this view, the violator is disqualified from serving as a witness on the level of Torah law.
In any event, this discussion alerts us to the importance of carefully choosing one’s witnesses whenever witnesses are required, such as at a wedding. One should ensure to choose as his witnesses the most righteous and pious men available, in order to guarantee their eligibility.
Summary: A person who willfully committed a Torah prohibition that is punishable by corporal or capital punishment, or who intentionally beat his fellow, is disqualified from serving as a witness, such as at a wedding, for the signing of a Ketuba, or in a hearing of Bet Din.