It looks to me like the couple lived in Bailieboro, got married, didn't have much so Mary, as many women did, goes to the workhouse to give birth, a midwife at home would have expected payment, John doing his best to provide for his family had to move around sometimes to find work and sadly died while working in Drogheda.
It's also possible he would have gone to the workhouse if he was ill before he died, if there was no room in Bailieboro he may have been sent to Drogheda, but if that was the case I would expect it would say of Bailieboro on the death cert.