late 14c., mortuarie, "customary gift due to the minister of a parish on the death of a parishioner," from Anglo-French mortuarie (early 14c.), from Medieval Latin mortuarium, noun use of neuter of Late Latin adjective mortuarius "pertaining to the dead," from Latin mortuus, past participle of mori "to die" (from PIE root *mer- "to rub away, harm," also "to die" and forming words referring to death and to beings subject to death).
Selden says that the usage anciently was, bringing the mortuary along with the corpse when it came to be buried, and to offer it to the church as a satisfaction for the supposed negligence and omissions the defunct had been guilty of, in not paying his personal tithes; and from thence it was called a corse-present; a term which bespeaks it to have been once a voluntary donation. [Sir Thomas Edlyne Tomlins, "The Law Dictionary," London, 1835]
From mid-15c. as "a funeral service." Meaning "place where bodies of the dead are kept temporarily" is recorded by 1865, a euphemism for earlier deadhouse.