First of all, the melody, rhythm, and bluesy structure of the original recording is a more or less direct ripoff of Gordon Jenkins' "Crescent City Blues." There is a reason the original version faded into obscurity: it is part of an experimental album by Jenkins, a narrative of seven "dreams" that fade into one another and don't have any real direction. The melody is comprised of a simple E-A-E-B7 chord progression, which is ripe for embellishment. Cash upped the tempo, making it more of an urgent, guitar-driven beat than the big band, shmoozy original. So yes, Cash did plagiarize the music, but he certainly made it a whole lot better.
The second version, the live recording, is really what propelled the song to fame, mainly because of all the "extra" sounds that happen throughout. According to music writer Michael Streissguth, the sound of an inmate hollering "Woo!!" after Cash's "I shot a man in Reno" line as well as the booming P.A. announcements were actually dubbed in by producer Bob Johnston in post-production. In reality, the inmates were relatively controlled and quiet during the performance so as not to upset the prison wardens. In any case, the sound of the crowd throughout, the sporadic cheers, and the echo of Cash's voice off the cement walls all give the recording a raw feel that is perfect for the setting and the emotion invoked by the music. Johnston created a soundscape of Folsom Prison that was decidedly larger than life and invoked an almost surreal and romanticized vision of hardship in the U.S.A. The album was a masterpiece of musical creation that took the combined efforts of Cash, Johnston, June Carter Cash, the media, and a whole lot of post-production work in order to carve out the perfect picture of Cash: a compassionate, gritty, no-nonsense dude whose deep baritone and blunt lyrics personified the promise of the American Dream.