That rule is NOT A LAW. It is a POLICY of the US Soccer Federation. They have absolutely ZERO jurisdiction to determine Criminal, Civil or Common law. Law's are developed by the government and society. Rapinoe could protest and possibly sue the soccer federation but many folks have lost that bet. If she wants to play with the team, she has to follow the policy. But she is free to do what the hell she wants, when you get down to it. She just have to be prepared to suffer the consequences.
Society used to self govern folks that didn't tow the line. Those folks were usually ostracized and lost all sponsorship and corporate backing. This society is becoming much more tolerant to acts of protests. It is most likely pretty easy to find a jury to award compensation if she was blackballed.