Hamburgers aren’t inherently unhealthy (though I’ll concede that in practice they often are). A well-made hamburger contains part protein, vegetables and carbs. It’s a whole meal. A bit too heavy on the carbs maybe, but not extremely so. It can stand on its own with very few additional flavour components, and has the potential of being a more wholesome meal than many others.
The issue, rather, is twofold. First, almost all burgers skimp on the veggies and generally use low-quality ingredients, instead relying on other flavour components (i.e. too much sugar and salt, and often added fat in the form of low-quality cheese and bacon). And secondly, burgers are umami bombs and lead people to overeat, both in terms of quantity (serving size) and frequency.