Fasting to lose weight is known as "dieting." If dieting is done in moderation and with the supervision of a doctor or another qualified medical specialist (e.g., nutritionist), there is nothing wrong with dieting in order to look better. It can also be done as a penance for past offenses against the body, such as gluttony. So, yes, your confessor is correct.
If you are planning to undergo fasting on any kind of scale besides what the Church prescribes for everyone on Ash Wednesday and Good Friday and on days of fasting occasionally requested by a bishop or the pope for special intentions, in addition to qualified medical supervision, you really should consult also with a balanced, orthodox confessor and/or spiritual director -- particularly if you are even thinking about attempting the heroic fasts of saints like St. Catherine of Siena, who subsisted for periods of her life on handfuls of herbs and the Eucharist. You may not have issues with food now, but radical fasting without the proper medical and spiritual supervision could create them.
Can self-mortification be overdone?