The atmosphere surrounding the assasination was such that a rush to judgement occurred. 17 or 18 indiviuals were hung as consiprators but Mudd received a life sentence. In 1869 Andrew Johnson pardoned Mudd. What do you know that Johnson didn't?
Four people were executed, not "17 or 18," and Johnson pardoned Mudd in a group with every other still-living conspirator, mostly because Andrew Johnson was a pretty lousy president, the Jimmy Carter of his time, not because Mudd was any less guilty than Marc Rich. The evidence in front of the tribunal was damning, and a brief run-down is here: Samuel Mudd
It would be closer to the mark to say that the investigation and trials were a marvel of scrupulosity. The complicating factor is that the investigators had to distinguish among degrees of involvement. Booth was active throughout the war in the confederate underground. Most of the places he stopped during his flight, including Dr. Mudd's, were known safehouses. Then you have Booth's closer circle of associates and, within that, the participants in the aborted kidnapping plot. The assassination was a last minute, end-of-the-war improvisation, and the provable hard core assissinators were few in number.
Dr. Mudd was certainly active in the confederate underground and was probably in on the kidnapping plan. There was, however, no evidence to tie him to the assassination. He was treated correctly. Those who hung were guilty as sin.