The decline of deficiencies has a lot to do with fortifying processed foods with various nutrients, and generally food being cheap enough that poverty is more associated with obesity than starvation.
Obesity and nutrients deficiency aren't mutually exclusive. e.g. "Studies have shown that many people with obesity have inadequate intake of iron, calcium, magnesium, zinc, copper, folate and vitamins A and B12, likely as a result of poor diet quality"