This is just wrong. Someone can eat mcdonalds 5 days a weak and still not be obese. Someone can eat nothing but whole grains, fruits, and vegetables and still be overweight.
Its nothing to do with being able to afford healthy vs unhealthy foods; mostly because fruits, vegetables, pasta, and grains are not expensive relative to potato chips and soda, and also because diet is only a small contributor to weight gain.
Generalizations make life easier but they arent always true.