I suspect many drinking songs were ribald parody of hymns.
The hobo anthem Hallelujah, I'm a Bum (1928) uses the melody of the old Scottish hymn "Revive Us Again." The singer, Harry McClintock, aka Haywire Mac or simply Mac, makes reference to my favorite robber baron, James J. Hill.
Joe Hill's 1911 rant The Preacher and the Slave, aka "Pie in the Sky," performed here by Comrade Pete Seeger, is a parody of the popular nineteenth century hymn "In the Sweet By and By." Incidentally, Hill was executed for murder in 1915.
Those old hymns generally came from funeral dirges. Medieval times were all about funerals.