Obesity can be caused by mental health problems. People with anxiety or depression might overeat as a way to cope with it.
But I wouldn't say it's always the result of a mental health problem. It's also a nutrition problem, an education problem, a time problem, a food desert problem. It's a difficult thing to just assign a 1 size fits all diagnosis. Sometimes the causes will be personal, other times they'll be communal, and some times it'll be a mix of both.