There is nothing wrong, as far as Islamic Shari`ah is concerned, in a Muslim woman going to gym on condition that she abides by the guidelines of women playing sports and it does not distract her from something obligatory.
Elaborating on this, Sheikh M. S. Al-Munajjid, a prominent Saudi Muslim lecturer and author, who states: “There is nothing wrong with a woman doing exercise or going to gym if it is in a place that is only for women, where men cannot see them, so long as it does not distract her from something that is obligatory, and it does not lead to her missing prayers or delaying them until their time is over, or neglecting other duties.”