Why do woman in politics face such scrutiny over their hair and clothes?

In the satirical TV series Veep, the female politician played by Julia Louis-Dreyfus gets serious about becoming the first female president.
So she cuts her hair off. Even the short style she had before, she explains, was “too sexy ... people didn’t take me seriously enough as a result”.