Welcome to the forum.
This has been covered before, even as recently as the last week or two. Try the search feature.
The basic problem is a lack of light. Our eyes adjust pretty easily but most gyms are really quite dark for photography.
You don't mention what lens you have, but I'll guess that it's probably not a 'fast' lens (large maximum aperture). This is the number one thing to upgrade if you are shooting in these situations.
Also, you other option is to turn up the ISO on the camera.
Both of those will allow you to shoot with a faster shutter speed, which will help to freeze the motion of your subject.
Lastly, the lighting in some gyms has quite a color to it, so it would help if you used an accurate white balance setting or just shot in RAW mode so that you could adjust it afterward.