The contrast with religion is the key to it. At the beginning, they thought it was an ordinary sort of sickness and turned to prayer in hopes of warding it off. When that does not work, though, and the sickness would continue unabated regardless of their prayers, they threw them aside and turned to pleasure -- one last fling before death.