I tried the whole workout at home thing with P90x. Just not my thing. I wanna relax at home not workout. So I do endorse gyms. However, I do think gyms are terrible for novices.
Meaning, a typical gym you're basically fucking around if you're a novice. Go on the elliptical, do some bicep curls and leave. You usually need to be hyper motivated to get more info on programming. Most people don't follow a program written by experts.
Although some Crossfit boxes suck, this is were the better ones get it right. They have mandatory classes to learn fundamentals. It's group based, so you make friends and get more motivation. It's skill based. You learn stuff like olympic lifts, gymnastics, not just your normal globo gym routine that I mentioned above.
But most people, unless highly motivated or just have pretty simple goals--just doing cardio for example, tend to spin their wheels at gyms and it never becomes a life time habit.
Say what you will about meatheads, but the nicer ones, and I never meat the stereotypical ones that you see in Planet Fitness ads, are dedicated and are very helpful and they're usually being doing it for years.