Is one halachically allowed to be fat (overweight or obese), or must a fat person take steps to reduce their weight and maintain a reasonably healthy body (and likewise, a healthy person must not allow themselves to gain weight to an unhealthy degree), due to shmirat hanefesh?
There is a basic halacha of "Ushmartem es nafshosechem" - loosely translated to mean that a person is obligated to maintain their body in good health. The reason for this is twofold:
Firstly, your body is only yours on loan from Hashem, and just as a shomer is obligated to guard and protect an object given to him for safekeeping, so too a person has to protect his body and ensure it is in excellent condition. Since obesity is destructive to a person's well being, being obese, or for that matter not taking action to keep your body healthy, would be in violation of "Ushmartem es nafshosechem" as you are being derelict in your duties as a shomer.
Secondly, keeping Torah and Mitzvot requires vigour and enthusaism, and a perpetual sense of "Ivdoo es Hashem Besimcha". These requirements are often compromised when one is obese or unhealthy, which may lead to lethargy and melancholy, both which will adversely affect ones avodat Hashem besimcha.
These above comments can be added to if we take into account chassidic aspects of indulgence in food. Put simply, there is a basic doctrine of "hiskafya", which simply means self-restraint. That is, restraining ones self from excessive eating for purely pleasure, rather than eating for maintaining ones health. There is a well known chassidic saying: "What is forbidden - is forbidden. And what is permissable - is not necessarily to be done".