Is poor nutrition over time caused by not eating healthy food?

Yes. that is one cause, another cause is a problem with absorbing food. A third cause is a problem with metabolizing the right food. So for example, a person with inflammation of the gut, may eat healthy foods and not absorb them due to inflammation in the intestines. Celiac and Crohns are two examples, and can be tested for.