One of the problems with going to a gym is it is easy to fool yourself with it. If you are going there for cardio to lose weight and burn calories you need to do the work. If you drive there then sit on an exercise bike twiddling a low gear at low cadence or walking slowly on a treadmill, then no, it's not going to happen, especially if you have a food reward afterwards. If I decide to go for a bike ride and I'm going to ride 25 miles then I've burnt x calories, but equally, if I go to the gym and work hard for an hour or two doing proper cardio exercises then I've burnt those calories too.
As Andy says, it's not all about cardio. I *could* spend all my time riding my bike, but I go to the gym to do weight work for core strength and stability. I'm generally not going to lose weight from it, but I understand that for the goals I want to achieve I need to do *both* cardio *and* strength exercise. Weight exercise is not all about the bodybuilders - it's about flexibility, core stability, mobility. There's also the fitness classes. Some people like the motivation from them. It's effectively having a personal trainer in a large group - you don't need to have a plan, you can be told how to work out.
The key thing about whether you get value for money from a gym is knowing why you are there. You might want to sit in a sauna & jacuzzi for a couple of hours a week, if you are happy to pay the membership to do that, then that's fine. You might want to do high calorie burn workouts 5 times a week; if you are happy to pay the membership to do that, then that's fine too. If you want to walk on a treadmill once a week and know that that is all you are there for, then as long as you are happy, it's still value for money.
As for being able to do most stuff outdoors for free: I live by the sea. I could go swimming in it every day. That doesn't mean I want to.