To muddy the waters even further...I remember in one of the original "Reprints" books I got mine in the 60's, it had the information that the song had been originally written as a jingle for a company that made plastic 'Jesi'. Anybody confirm that? - my memory's uncertain and the wee books are packed away somewhere.
I think perhaps in "Cool Hand Luke" it was used to show a certain amount of pathos for the character, that in a moment of grieving for an emotional loss (news of his father's death, was it?) the only comfort he could find, perhaps the only "religious" song he knew was a commercial jingle.