State law allows PE exemptions for medical illness.
General Laws of Massachusetts 71.3 Physical education
Section 3. Physical education shall be taught as a required subject in all grades for all students in the public schools for the purpose of promoting the physical well–being of such students. Instruction in physical education may include calisthenics, gymnastics and military drill; but no pupil shall be required to take part in any military exercise if his parent or guardian is of any religious denomination conscientiously opposed to bearing arms, or is himself so opposed, and the school committee is so notified in writing; and no pupil shall be required to take part in physical education exercises if a licensed physician certifies in writing that in his opinion such physical education exercises would be injurious to the pupil.
Comprehensive guide with components on physical activity; includes information regarding class exemptions, specifically in cases where participation would be "injurious"