You can’t call it a side effect simply because the drug was first studied for a different condition.
Weight loss is a primary effect of the drug and it’s the indication it was approved for after extensive research.
Many drugs are first discovered while looking for some other effect.
Now, Wegovy has the same active ingredient as Ozempic (Semaglutide), ditto for Zepbound and Mounjaro (Tirzepatide), and the latter have been prescribed off label for weight loss in the past but it's not just a marketing gimmick. These are different drugs in the eyes of the FDA because they are prescribed for different things (obesity vs. type 2 diabetes).
As I said above, they ran it through some amount of clinical trials and got approval to mention it directly. Same drug matter, possibly the same formulations.