For the most part, Johnny Cash's songs—especially his most famous ones—are very simple in their melodic structure. "A Boy Named Sue" is especially indicative of this trend, with a steady repetition of G - C - D - G, in the key of G Major.
Melody aside, with "A Boy Named Sue," the music comes secondary to the lyrics. It sounds like something you would hear while sitting around a campfire on the open plains: a man telling a story to his buddies while someone just happens to be picking out chords on his guitar in the background. The music provides the stage for "A Boy Named Sue," but the lyrics are always the main event.
What might jump out more than anything from the audio track is actually the crowd reaction, as San Quentin's prisoners laugh and jeer with each punchline throughout the song. Hearing the crowd response puts us right there in that room with Johnny and the inmates. More rooted in the older tradition of oral culture than the modern concept of rock and roll, "A Boy Named Sue" is a narrative set to music, and not the other way around. During Cash's long career, he performed songs that could be considered folk, rock, gospel, and blues...but this song is definitely country.