I couldn't get the link to work, although the address looked correct. I had heard the phrase came from combat solders in WWII, who were always talking in the foxholes about buying a little farm after the war was over. So, if a guy was killed in action, he "bought the farm".
But I also found this site, Whats the meaning of this which has a couple of different ideas about where the phrase came from.
Aviation. The old planes, I think specificaly open cockpit mail delivery planes, were very dangerous and unreliable. They often made forced landings in farmer's fields. When they did so, they had to compensate the farmer for any crops damaged/destroyed by the plane. If they were killed, by implication it was a really bad carsh, and they 'bought the farm'.
I agree with karmakanic. I work in the insurance industry, and it has always been said that GI's were able to buy GI life insurance during the wars. Usually, his family was the beneficiary. When a GI got killed, the insurance was paid to his family and they sometimes used the proceeds to pay the note on the family farm, hence the saying.