I look at it like this: if a food doesn't spoil, it is most likely because bacteria and fungus can get no nutritional value from it. Do I want to eat that?
2. There are some exceptions, of course, but surprisingly few.
Here are two other reasons bacteria might not be able to eat something you can eat:
1. They can't stand the chemical environment -- pH, poisons, salinity. You're just eating it, and can compensate for a lot; they have to live in it! Examples: Honey, garlic, onions, hard liquor, vinegar, salted butter.
2. It's too dry; you can drink extra water, but they need it to come from the environment they live in. Examples: Any dry food, really, but stale bread and dried meat are good examples.
. . . and cheating a bit, here's one more:
3. The food could spoil, but is in an otherwise inhospitable environment -- too cold, too hot, no oxygen, already sterile/sealed. Examples: Frozen food, food in the slow cooker, canned food.
None of those have much to do with nutrition! You're just a more robust organism than bacteria, is all.
Even "poisons" in the first one is misleading -- a lot of what the microbial world sees as poison, you and I see as tasty. :)
Brown rice and dried beans don't spoil and are extremely cheap. Most other foods can be frozen to prevent spoilage.