Hillary Clinton’s defeat last year sparked an intense debate about the role of gender in American politics, but the presidential race overshadowed a deeper structural challenge for Democrats: They have a scarcity of female officeholders in state capitals.