I agree that airlines do not have contingencies for storing dead people.
According to the American Journal of American medicine, the mortality rate from in-flight medical emergencies is 0.21 deaths per million passengers (Jones & Lee, 2023).
there’s something like 800 million passenger flights domestic and international for US airlines
so that’s around 168 deaths in-flight (domestic and Intl) that US airlines have to deal with. FWIW, the number of in flight health emergencies is much higher - about 18 per million. Obviously, few of those result in immediate death.
So for 168 total deaths, are aircraft builders and airlines going to go to the probably huge cost of designing, building, training staff, etc... for on-board morgues/caskets/cold storage? Probably not
Drop them in the baggage compartment. It’s pretty cold in there. Or put a parachute on them and toss them out the door. Trust me, they won’t care.
You've already pointed out that in-flight medical emergencies are far more common, and yet airlines don't have medical doctors on hand to deal with them. Instead, the pilot will usually just ask, over the PA system, if there are any medical doctors on board who could "help out."
By the same token, the pilot could instead ask, "If there anyone on board with experience as a mortician or orderly in a morgue?"
In my opinion, the whole matter could be dealt with far more expediently by designing all aircraft to have a chute for such exigencies.
If the aircraft were flying over water, it could even be regarded as "burial at sea."
Regards,