Gyms can be good to get a variety of exercise, especially the aerobic types with running/rowing/stepping machines. I just lack the time to get to a gym, so I took up running and am now doing the '7 minute workout' that is all bodyweight based. Cost is practically zero, but you need decent shoes to go running. I may get a few of these for some variety.
I often go through stages where I like going to the gym and others where I like working out at home. It's great to have the home option IMO.