Mack Beggs is biologically female, and is taking steroids, which dramatically increase muscle/power/strength, in order to 'transition' to a male.
According to Texas school sports laws, she must compete according to the gender on her birth certificate - female.
Steroids are banned except if for a 'valid medical purpose'. In this case the medical purpose is to become a man.
So the rules are apparently quite rational, but whereas one is unambiguous - you compete as the gender on your birth certificate, the other - the 'medical exemption' is not.
sportsday.dallasnews.com/high-school/high-schools/2017/02/18/transgender-teen-wins-regional-wrestling-title-despite-attempt-ban-competing