Sweating just means that your body temperature is higher than normal, and you can excrete water to lower your body temperature.
People always say that sweating can lose weight, because most of people's sweating is due to the increase of body temperature caused by exercise. People associate sweating with weight loss. Actually, it's exercise that makes you thin.
Of course, sweating also consumes some energy.