Unhealthy foods are harmful these foods make our stomach upset and can also harm our teeth.Therefore we should avoid such foods.
it's not that you TOTALLY avoid unhealthy food, You avoid excessive consumption of it. Some people eat too much, say ice cream, for example that their diet has too much fat and/or sugar.
Think of unhealthy food as like liquor, Having a nip now and then isn't going to kill you. Getting skunk drunk every single day probably will. I am not vegetarian anymore so I do eat meat. But it's not all I eat. I still have (I think) a balanced diet of meat, fruits, vegetables and occasionally grain.
And having a treat, nutritionally unhealthy or not, is healthy for your general feeling of well being.