Why does everyone keep assuming it’s because it’s distracting to boys? Most places have a dress code. Many people do not know how to dress appropriately. Boys or girls with half their butt hanging out should be sent to change. That is not appropriate attire. Some of the shorts for the girls that they sell are like denim underwear. Their cheeks are hanging out. I call them heiney hangers. It has nothing to do with being distracted. You shouldn’t have your parts hanging out in a school. Personally I don’t think they should be hanging out anywhere but maybe there is a place where that’s a thing. I don’t know. I don’t go anywhere that it is. Boys also should not have their pants hanging low either. Your underwear does not need to be hanging out because your pants are pulled down to your knees. Ymmv.
I think you are exaggerating what kids are wearing to school. I have seen countless girls dress coded, but I have never see any wearing what you describe.
Here’s an example of my own child.

I find nothing revealing about these shorts. There are certainly no “cheeks or heiney” on display as you describe and yet she was sent to the office every time she wore these or something similar to school.
Also, many of us are not “assuming” that the dress code is intended to prevent boys from being distracted. Many school handbooks explicitly state that is the case.