When you want to do something for the sake of Allah, it should truly be for the sake of Allah. You have to struggle and strive to please Allah primarily. Everything else needs to be a secondary intention. Your prime focus should be pleasure of Allah by performance of a good deed.
Your focus cannot be weight-loss primarily. When you are fasting for the sake of Allah, what you do during the fast matters. You are not just starving yourself from food. You have to change your attitude.
Shaykh Abu Eesa answers and explains..