You can gain weight on a diet of "healthy" foods. It's the amount of calories. Being overweight is bad for your health even if you only eat healthy foods.
And as you know, fueling the body with excess macronutrients is unhealthy. Indeed, eating a diet poor or absent in micronutrients is bad for you, but also quite rare.