I think you should take other things into consideration as well.
Maybe others can help me out with questions you should ask yourself before doing either, but I'll start out:
1) Do you get motivated by working out around other people?
2) Do you get agrivated/annoyed by working out around other people?
3) What price will be higher, the total lifetime cost of a home gym (with all necessary equipment) or a gym membership.
4) How far is a gym from my house, and is there one close by with all the equipment I need/want?
5) Can you stay motivated to work-out at home with so many 'distractions' so close by (like TV, couch, refrigerator...)?
I personally want to get a home gym once we finaly get our own house, but I am worried about my own motivation to be consistant at home. At least at a gym, if I go there, I'm going to finish my workout.
On the other side, if I'm too lazy to go out to a gym, having a home gym might stop me from missing a workout too.