You can only use your Health Savings Account (HSA) to pay for fitness classes if your physician or nurse practitioner prescribes an exercise regimen for a specific medical condition.
Your physician must write a letter of medical necessity (LMN) confirming the classes are intended to treat or prevent a medical condition, and you must provide a copy of the letter to the IRS when filing your taxes. The LMN is typically good for one year from the date it's signed. However, your physician may recommend a shorter duration.