The court analogy is not a good one. Barristers and judges wear robes and wigs to disidentify themselves. In court they are there to represent the law, and so they dress to erase their personal characteristics, which includes a specific requirement to wear dark clothing (in criminal law at least. In the Supreme Court where robes are not worn, the dress code is different.) This is both traditional and a formal requirement.
And school uniform is an even worse analogy, given it requires children to dress identically.
That’s not the case in the Commons, where Members are both adults and there to represent their party and constituents, and the formal dress code doesn’t specify colours. Many wear the red, blue, yellow, green or turquoise of their party. Many women also wear other bright colours, or even white. Just as many women in business do.
The ultimate guardian of the rules is the Speaker, who could refuse to allow Hannah Spencer to speak if she dressed or behaved inappropriately. They did not, so anyone else’s opinion on her clothing is irrelevant, and any journalist writing about it is scrabbling around for pebbles to throw.