im sure you can find a bunch on yelp. there's probably a sport club or a 24 hr fitness thatll meet your needs. might even want to check out the rec centers out in san jose state or santa clara university.
though its pretty far from you, i'm a member at dream courts in hayward. currently there's 7 full courts, and the next phase of the gym should be opening up another 10 for leagues and whatnot. $7 entry per day or $39/month (for 1 year). the ventilation sucks in the building, and all they have are a bunch of fans scattered around. if you want to make the drive, try coming here. they're open til at least midnight. 1am on a good day.