Its so asinine that literally every other human being on planet Earth understands why it is so except you. Our entire legal system ascribes the dead an extremely large value, because of cultural reasons, not theological ones. If it was theological, it would be seen in only one or two religions, mostly related to one another, something like the Abrahamic religions are related to one another. Rather, it exists in virtually every human society, regardless of religion.
You can't pack a million people in a city without coming up with ways to respect all the dead people you're going to be dealing with. Its a sign of a society which is breaking down, such as during the Plagues of Europe, or during the Holocaust, when the dead are no longer able to be treated with veneration, and instead are piled up in droves, burned, buried in mass graves, etc.
The sanitary aspect of the modes of disposal represent a selection pressure on those irrational beliefs that leaves us with irrational beliefs that have some useful side effects, but that's not relevant at all.
Its actually the most relevant aspect of this, because ALL events which impact on human evolution, cultural and biological, come about as useful side effects of gradual change...that's the entire point. Discarding the useful side effects because you think the initial change which led to them is irrationally based is a terrible idea, because you're losing all the benefits that go with it. Sickle cell anemia would be a good example of this. Its completely irrational, biologically, to have sickle cell anemia propensity on a genetic level. It raises your chances of dying early. Except in areas where there's lots of mosquitos. Then people with one of the two alleles which cause sickle cell anemia have an inherently much greater resistence to the negative effects of malaria, and now what is the side effect of a completely irrational mutation leads to increased survivability.
Cultural adaptations and physical adaptations are a spider web of cause and effects like this, and claiming that because a causative effect doesn't appear rational to YOU therefore it has no value is an immense presumption on your part, that will quite often be disproven by simply applying a different perspective or framework to the problem.