It's similar with nails. If you tour Jefferson's home Monticello, there was a "nailery" where the nails needed were forged by hand, one by one. Being handmade, the each nail was valuable.
People would burn scrap lumber to recover the nails.
I did too. These days, I save nuts and bolts. Not because they are expensive to buy, but I don't want to spend a couple hours going to the hardware store to get one.
I have two clear plastic drawers from a refrigerator I had 15 years ago almost overflowing with extra hardware. While it’s mostly just nuts, bolts and nails I also throw any extra part that comes with random widgets. I just dug through it yesterday to find two small machine screws to tie together a broken plastic connector. It’s not hoarding if you use it right?
Yeah, I have a tub with random springs, brackets, spacers, clips, and odd metal bits pulled off of devices I threw away. It's surprising how convenient it is when you need something.
Casting parts like that is actually incredibly difficult. The iron will want to freeze before filling the mold cavity, since the cross section of a nail is so small. While tedious & time consuming, hand forging a nail is significantly easier than attempting to cast one. Plus, cast iron is much more difficult than forging simply due to the much higher temperatures required. A simple charcoal fire is adequate for forging, the higher temperatures required for casting necessitate specialized equipment. Hence why many village blacksmiths didn't have the capacity to produce cast iron parts.
People would burn scrap lumber to recover the nails.