Scholars (Sunni) said smoking is haram because it comes under the heading of al-khabaa’ith (that which is evil and unlawful), and Allah and His Messenger have forbidden al-khabaa’ith (that which is evil and unlawful). Allah says, describing the Prophet (blessings and peace of Allah be upon him):
“he allows them as lawful At-Taiyibat ((i.e. all good and lawful) as
regards things, deeds, beliefs, persons, foods, etc.), and prohibits
them as unlawful Al-Khabaith (i.e. all evil and unlawful as regards
things, deeds, beliefs, persons, foods, etc.),” [al-A‘raaf 7:157].
Shaykh Muhammad ibn Saalih al-‘Uthaymeen (may Allah have mercy on him) said:
The evidence for the prohibition of that which is harmful is to be
found in the Qur’aan and the Sunnah.
From the Qur’aan:
“and do not throw yourselves into destruction” [al-Baqarah 2:195]
“And do not kill yourselves (nor kill one another)” [an-Nisa’
The prohibition on killing oneself is also a prohibition on the means
of doing so. Whatever causes harm is haraam.
The Prophet (blessings and peace of Allah be upon him) said: “There
should be neither harming nor reciprocating harm.” We might also quote
as evidence the verse in which Allah says (interpretation of the
“But if you are ill or on a journey or any of you comes from answering
the call of nature, or you have been in contact with women (i.e.
sexual intercourse) and you find no water, then perform Tayammum with
clean earth” [al-Maa’idah 5:6].
The point here is that Allah enjoined tayammum for the one who is sick
so as to protect him from harm and to offer him an alternative to
water, which may harm him if he uses it when it is cold and he is sick
and so on. .
Ash-Sharh al-Mumti‘, 15/12, 13
He also said:
In the case of that which is harmful in conjunction with something
else, such as if this food is not compatible with that food, in the
sense that if you eat the two foods together it will result in harm,
but if you eat them separately that will not result in harm, and the
doctor has advised this dietary restriction for one who is sick and
has told him, “If you eat it, it will harm you,” then it becomes
haraam for him.
If a person feels that some kind of food will cause him harm or give
him indigestion, then it becomes haraam for him.
If a person says: If I fill my belly with this food, I will need water, and if I add water to it I will hardly be able to walk and it will bother me; and if I sit it will bother me, and if I bow it will bother me, and if I lie on my back it will bother me, and if I lie on my stomach it will bother me. In this case, he says:
If he fears that it will harm him, then it becomes haraam for him to
eat it. And what he said is correct, because it is not permissible for
a person to eat that which will harm him or to wear that which will
harm him or to sit on that which will harm him. Even the Sahaabah (may
Allah be pleased with them), with regard to prostration, if the heat
would harm them, they would spread out their garments and prostrate on
them, lest they be harmed and so that they might be at ease in prayer.
And he said:
If it is said to a man who has diabetes: Do not eat dates or sweets,
then dates and sweets become haraam for him, because they are harmful
for him and he has to avoid them, but they are halaal for others.
Liqaa’aat al-Baab al-Maftooh, 229
So what we understand is there is no general prohibition on these foods. However, if someone eats it extravagantly and it causes him health problems, it becomes haram for him since he is ruining his life.
Source and further reference: Coffee, tea and sugar can be harmful; are they haram like cigarettes?