To many, the figure of speech to buy the farm sounds like a day-dreamy but worthy aspiration from a more gentle, rural America, a time of cows in pasture mooing lazily and sun-drenched fields of crops waving gently.
Actually, though, the expression is extremely grim rather than bucolic. Plain and simple, it’s used to indicate someone is dead.