For a pistol that size, the only real choice is a fanny pack designed to carry a pistol. Many are designed to look rather innocuous. Unfortunately, depending on your preferred workout, you may have to take it off at some point (if you wear a lifting belt for squats or deads, for example). Then a fanny pack becomes off-body carry by default. I'm not a fan.
I vote for locking it your car in a small gun vault designed for that purpose. Whatever you decide, do NOT lock it in a locker. There are some people who go to gyms and rec centers specifically to break into lockers just to see what they can steal: wallets, phones, watches, jewelry, and, yes, firearms. Most lockers at commercial gyms can be popped open with a screw driver. If you buy a big, expensive lock with a hardened hasp, all that does is tell the thief that there is something worth stealing inside.
Personally, I feel pretty safe in a gym. The weight stacks on machines would make decent cover, and a five-pound plate or two hurled at someone's head would make him think twice. There are usually mirrors everywhere, so someone would have a hard time flanking you. If you still feel the need to be armed at the gym, pepper spray or a neck knife is way more doable than even a compact, double-stack pistol. However, if you stay well clear of those chest thumping, alpha-silverback threat displays, you shouldn't really have too many problems in the gym. But, like anywhere you go, keep your head up in the parking lot.