Join a Clean Gym
The most important step you can take to ensure you stay clean and healthy at a gym is to join one that isn't dirty. When shopping around for gyms, make sure you take note of what the machines look like. Get a free trial pass and go more than once before you join. This will give you a good idea of how clean it is on a daily basis.
Wipe Down Machines
While you're at the gym, one of the best ways to keep yourself from coming into contact with germs is to wipe down the machines before you use them. In a perfect world, everyone would use antibacterial spray to clean up their own mess. Since you can't know for sure who cleaned up and who didn't, wipe down the machine before you use it. Once you're done, wipe it down again so you don't leave your sweat and germs all over the pads.
Another way to minimize your contact with other people's germs is to bring a gym towel. Place it over the machine you're using so that you sit on the towel instead of the machine. You can also use it on the floor if you need to do any stretches or exercises and don't trust the cleanliness of the mat. If you do yoga, buy your own mat. Make sure that you wash your towel and mat frequently because they can turn into a breeding ground for bacteria.
Wash Your Hands
After you're done with your workout, wash your hands thoroughly with warm water and soap. This will drastically reduce the amount of germs on your hands.
If you wear the same shirt and shorts to the gym every day, you need to change your habits. When you sit on a machine, the bacteria cling to whatever clothes you're wearing that day. The bacteria can start to multiply and if you wear the same clothes each day, they'll start to move onto your body and can make you sick.
If you're doing multiple sets on a machine, it's common courtesy to let others work in during your rest periods. This may not always be practical, but offer to share whenever you can.
Clean Up After Yourself
My biggest pet peeve is someone who walks away from a machine, leaving a slimy pool of sweat behind. Thanks! Always bring a towel with you and wipe the machines down when you're finished. Most gyms offer wipes or sprays strategically located around the gym for this purpose.
Leave No Trace
My next biggest pet peeve is the person who leaves 6 million pounds on the leg-press machine. I don't know, maybe I look stronger than I am. The point is, always put your weights back when you're finished.
Don't Hog the Treadmill
Many gyms have time limits on cardio machines during busy hours. There's a reason for that, and you should obey it. And no, throwing your towel over the display doesn't fool me.
Keep It Down
Most gym-goers I know have seen That Guy. The one pumping away on the treadmill while screaming into a cell phone. Unless it's an emergency, save your chat time for after your workouts.
Cover It Up
I respect the confidence that allows some people to walk around the locker room naked. Know what else I respect? Seeing you wearing a towel after your shower to keep the locker room a comfortable place for everyone.