Terry feels two kinds of guilt in On The Waterfront: he's guilty for playing a role in Joey Doyle's murder, but he also feels guilty about turning against Johnny and thinking about becoming a stool pigeon. Eventually, he realizes that only one of these two kinds of guilt is legitimate.
There's nothing praiseworthy about covering for a murderer: you shouldn't get a gold star for that. But you should feel guilty for playing a role in that murder. So, Terry—with an assist from Barry and Edie—gets rid of the one kind of guilt by testifying and doing his duty, and the other kind by dismissing it as false.
Questions About Guilt and Blame
Why do people put so much blame on Terry for testifying—yet, at the same time, the longshoremen follow him at the movie's end?
What does Charley feel guilt about, and why?
Does Terry conquer his sense of guilt by movie's end—has he actually made up for his role in Joey's death?
Chew on This
Guilt is a totally unproductive emotion. If Terry felt less guilty about betraying his gang, he would've testified against Johnny earlier.
Guilt is a highly useful emotion. If Terry hadn't felt guilty about Joey's death, he never would've turned against Johnny in the first place.