For me it was the feeling of feeling better. I've always been overweight but it's a downward spiral. The heavier I got the worse I felt and the worse I felt the less I felt like doing and the more weight I gained. You never want to get to that point and it happens faster than you think. Once I started losing weight I generally felt better and until I blew out my knee I was going to the gym regularly.
The gym can definitely help you lose weight but it's not how you lose weight. Your diet is how you lose weight, don't go on a diet, change your diet. Going to the gym will help you become healthier by building muscle, getting cardio, and staying active. Going to the gym will help you improve your health faster, your diet will make you fat or skinny but it will never make you healthy. Just be active and eat what your body needs, not delicious junk food.
Just start moving more in general. Once you feel you have plateaued then see if the gym works for you or not. Just move your body, as I'm typing this I'm reminded that I really need to move more often.