This term was used during World War 2 whenever a Allied Pilot would have to make a crash landing into a European farm/house. WW2 pilots who did this were actually charged for the damages they caused and actually in a sense:
"bought the farm"
Pilot: "I crashed landed my P-51 Mustang into this ladies barn and livestock."
Crewman: "Guess ya bought the farm ehh?"