There have been tensions between the FIDE organization and top players like Carlsen since the latter have been promoting an alternative chess organization around Freestyle chess (aka Chesss960), which has slightly different rules.
I.e. this is less about "dress code enforcement" and it is more about "Carlsen is fed up with the FIDE organization in general".
But if you are going to bother signing up, is 'jeans' really the hill to die on?
If the beef is with the organization, just boycott altogether.
Otherwise, just put on some pants.
EDIT:
Perhaps the downvotes are because of disagreement with methods of protest?
What brings greater attention to your cause?
1. A boycott, you just don't go to the event? And make a press statement about it, that probably doesn't get any headlines.
or
2. Sign up, go, then angrily get disqualified, based on some stupid rule, which gets a lot of headlines, and attention focused on silly rules of the organization?
Guess, if the goal was to effect change, then maybe this was the correct move. But if it was just being pissi, then why bother signing up, you know the rules, so just don't go.
Discretion should be a thing.
This being a thing at all certainly proves Magnus’ point. Its not 1970.