In most places this is actually relatively new. In many places there were laws that said only funeral homes could sell caskets. Retail sales is something that has cropped up in the last decade though it is still far from universal.
Note that Costco does not directly sell the caskets (but are rather acting as a front for Universal Casket Company. Notice also that you can only buy and ship the caskets to about 25 states. In the rest, interstate shipment is probably illegal or the state has more stringent restrictions on who can sell caskets.
Here is an example of the debate (biased towards on side) in Oklahoma.
http://www.ij.org/economic_liberty/o...8_24_04pr.html
Most of the so called "death care" industry is a scam that works on government protectionism and monopoly that would have made Standard Oil blush in embarrassment.