Gymnastics is a VERY expensive sport for most schools in terms of equipment and is also a high liability sport that a lot of schools would rather not mess with, at least not at their school facilities. Add to that the problem of schools not wanting to get involved if they don't have schools to compete against or need to travel excessively to get to, competition with gym clubs, the ability to find coaches, availability of gym space for practice time, the list goes on. It's sad because more high school gym programs would have the potential of introducing kids to the sport who would otherwise be unable to afford it, but there is just so much working against it.
I coach a HS team and we are so lucky the school has held on to it (it was one of the original girls sports at the school and some of our equipment is original to the program), but we are hard pressed to get the school to invest too much in the way of new equipment- much of that is on us as a program- and have to work around other sports at the school (share space with wrestling which is given priority, canceled practices if basketball or wrestling needs our gym for games/tournaments, deal with gym classes playing on our equipment because we have no place to store it). It's an uphill battle.
Some schools do allow school affiliated club programs for sports that the school does not have the facilities to support (or that the school does not want to be liable for). If your school allows this you can potentially find a local gym facility to practice at and compete under your school name, but then comes the problem of finding schools to compete against. But that's how HS gym worked where I went to school.