The origin of this phrase is uncertain. It is 20th century and all the early references to it relate to the US military. The New York Times Magazine, March 1954, had a related phrase, in a glossary of jet pilots' slang:
"Bought a plot, had a fatal crash."
That clearly refers to a burial plot. The 'bought' in that case probably doesn't suggest any actual or potential purchase, but to an earlier use of 'bought', that is, being killed. This dates back to at least the early 20th century. This example from 1943 isn't the earliest, but it does make the meaning explicit. It's from Cyril Ward-Jackson's It's a piece of cake; or, R.A.F. slang made easy: