Answer
Wa `alaykum As-Salamu waRahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
There is nothing with having two intentions for fasting; one to please Allah which is the primary goal of fasting and the second for losing weight.
Answering your question, we would like to cite the fatwa published on islamweb.net:
Fasting with the intention of seeking the pleasure of Allah and losing weight is not against ikhlas (sincerity). Rather, this is permissible without any harm, but fasting with the sole intention of seeking the pleasure of Allah is greater in reward.
We read in the book of Sharh Al-Iqna` (a Hanbali book):
“If a person, along with becoming pure from minor or major impurity, intends to cool himself or clean his body … then this does not affect the intention, like the one who intends to digest food by fasting, or to see a remote country and the like with the intention of Hajj; it does decrease the reward, however.”
Based on the above, you should know that a dual intention is not against ikhlas but that it decreases the reward.
Allah Almighty knows best.