What are the halachic issues with men and mixed gyms?
There are two issues with a man going to a mixed gym. The first one is the same a going to a mixed beach- he will see women when they are dressed immodestly. The torah tells us, (Numbers 15-39) “Not to stay after our eyes”, and not to look at woman Included in this is to look at women when they are immodestly dressed.
The second issue is even if the women are totally dressed, the man will see the women exercising and in positions that will cause him to have immodest thoughts, which is also prohibited.
Y:D 21-1 Bais Shmuel ibid 2, from Rabeinu Yonah