I put this together for another mapper who has requested such a function on more than one occasion, and I thought it'd be a good way to demonstrate prop spawning and some other tricks.
The map contains 2 buttons. The first will spit out a casket every time it's used. The second one's a little fancier - you have to pick up some wood before you can build a casket, and once you're out of wood, you can't build any more. Additionally, the wood can only be picked up by Survivors, rotates and has a glowing sprite to increase its visibility, and plays a sound when picked up.
Grab the .vmf here! The .vmf is ready to compile and play, or pick apart and examine.