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".
We will see how other players react today. Will they wear jeans in protest?
I agree that rules against jeans make limited sense. It makes more sense to forbid worn down or shabby looking attire. But one should abide by the rules one signs up to.
If it's the only competition in town, and the rules are unjust, and the organisation in question considers you #1 chess player in the world… I can hardly imagine better circumstances for civil disobedience.