The CyberHymnal says that William Hays (Salvation Hays) wrote the music to Lily of the Valley in the mid 19th century. So I reckon that someone picked up on the tune when they composed Wrangler Joe. So many folk, blues & popular songs come from tunes of gospel music and hymns. Probably a good many tunes go in the other direction as well.
Joe Hill and the other Wobblys often used hymns for the music of their songs. Utah Phillips said that they thought the tunes were pretty and they just added words that made more sense.
Anyway, I think it might be fun to hear about other tunes that have crossed over to and from the religious.