Often times you partner up on workouts, or at the very least talk over what the day's workout is. Many gyms organize both competitive (friendly) workout competitions (with other nearby gyms also) as well as social events with members.
The nature of group physical exertion (high physical stress) provides a low social stress environment to make casual acquaintances many of which can become close friends.
I see many in the comments lamenting the practical inability to strike up random conversations with strangers they encounter throughout the day. In the gym setting it is very easy to ease into these types of interactions when desired.. Over time without even trying you become pretty close with the trainers and members just by nature of being around them often, working together so to speak towards a common goal.
This is also a great way as a couple to make friends. You join together, and right from the start you're not on your own.. and often times there are other couples attending classes as well.