Note: This is a spoiler of the movie, but the movie is not an accurate portrayal of the life of Samuel Mudd. The movie clearly has a pro-confederacy, pro-slavery slant.
The movie opens with John Wilkes Booth shooting Lincoln in the theater. Booth jumps from the balcony to the stage, badly fracturing a leg, then escapes on horseback. As they travel the countryside at night, Booth is in severe pain from the fracture. They knock at a random house asking for the nearest doctor, and are directed to the home of Dr Samuel Mudd (Warner Baxter). They give a false name, and claim that Booth is travelling in such a rush to see his dying mother. Mudd sets the fracture and sends them off.
Mudd is charged with being part of a conspiracy to kill Lincoln. He is given a military show trial, in which he is not allowed to present any defense, or even to speak. He is sentenced to life imprisonment at Fort Jefferson in the Dry Tortugas. There he is hated by all, and treated badly. After trying to escape, he is kept locked in a dark cellar. An outbreak of yellow fever kills many people at the fort, including the doctor. As the only doctor on the island, Mudd is released to treat the soldiers and prisoners. Mudd manages to save many of them. The officers of Ft Jefferson send a letter to the president commending Mudd's bravery in risking death himself to save others. On their recommendation, President Johnson pardons Mudd. Mudd returns to his family.
Thanks Joseph C!