Not that I liked the gym, but for lazy people like me it's way easier than figuring that shit out on my own. There was a trainer who made a plan of which exercises to do when. And there were special machines for training different muscle groups that were very easy to use. You'd visit a lot of those machines after eachother and do for instance 3 sets of moving the weight 10 times up and down again. And apart from that there were the threadmills etc.
Now I don't know about you, but I don't have threadmills in my house, nor any of the other equipment, nor someone who knows enough about fitness to know what exercises would help me best.
That being said, I never liked it, I prefer to just start with something and keep doing that same thing for an hour or so. Currently I've been running multiple times a week for a few years already. Way cheaper and it also works better for me.