There are lots of other gyms in the city besides the wretched, filthy 24-hour-fitness syndicate: Club One (slightly more expensive, but better), Crunch Fitness (ditto), World Gym (caters toward meatheads), Fitness SF (formerly Gold's; tends toward gay/female clientele), Sports Club LA (super expensive; incredibly nice), Equinox (also super deluxe/expensive), Bay Club (ditto), Mission Cliffs and Planite Granite (climbing/hippies/hipsters), Planet Fitness (almost as cheap as 24hr; fewer locations but much cleaner), and the YMCA (moderately cheap, clean, functional). There are tons of smaller gyms, as well...mostly expensive crossfit and personal training outfits, but some boutique all-purpose gyms, too.
If you're looking for a gym, do yourself a favor and don't just sign up for a 24-hour fitness membership without looking around. You can do a lot better for not much more money. About the only thing you can say in favor of 24h is that they're cheap and open late.
If you can afford ~$60 a month, you have a lot of options, particularly if you negotiate. The YMCA is a good option in this range, and they don't jerk you around with contracts and high-pressure sales.