This actually is a novel idea. And it saves space. Pack more deads per square meter.
Families do pay for the coffins, but they also pay for burial costs as well (so they'd also be paying for space and a portion of the machinery).
I'm either getting an autopsy or donating when I die, either way I'm going to be stuffed with sawdust. I'm not going to make good worm food, so you might as well torch me.