Democratic presidential candidate and California Sen. Kamala Harris just announced her plan to close the gender pay gap, and it is sure to backfire on women in the workplace.

Harris may be pandering for female votes, but that is no excuse to use the misleading gender pay gap to push policies that would actually make the hiring of women less desirable and reduce workplace flexibility.

Harris would force private companies with 100 employees or more to prove that they pay men and women the same for the same work every two years through an “equal pay certification.” Employers could be fined 1 percent of their profits for every 1 percent difference in pay.

That’s a tremendous potential stick, but Harris believes it’s necessary because in the U.S. today, women and men do not earn the same pay for the same work because of gender discrimination. She couldn’t be more wrong.

On the Late Show with Stephen Colbert this week, Harris regurgitated the oft-cited and debunked statistic: “The law says that men and women should be paid equally for equal work, but what we know is that in America today, women on average are paid 80 cents on the dollar of what men are paid for the same work.”

Harris is right that the law prohibits discriminating against men or women in pay, but it does permit a man and a woman to be paid differently for valid reasons. Harris just ignores those reasons, which explain why men on average earn more than women.

When we control for factors such as hours worked each day, education, occupation, seniority, and time out of the workforce, the pay gap shrinks to a few cents. For example, women work fewer hours than men (an average of 8.3 hours compared to 7.8 hours per day) and fewer women work full-time than men. Controlling just for hours worked reduces the pay gap to 11 percent.

Hours worked, industry, and occupation are all choices women make to maximize flexibility or find fulfillment in work. The pay gap is not a sign of rampant gender discrimination, but the impact of the aggregated choices and preferences of women.

Black and Hispanic women allegedly struggle against even bigger pay gaps due to race: 61 cents and 53 cents on the dollar, respectively. But that is a comparison of their median earnings against those of white men, not their black and Hispanic male counterparts. Median weekly earnings of black women are 89 percent of those for black men and Hispanic women earn 86 percent of Hispanic men.

When we control for occupation and industries these minority gender gaps likely shrink as well. Black women are under-represented in management, professional, and related occupations that carry high salaries, but they gravitate to lower-paying jobs and careers in industries such as human services, retail, and education.

The point is that the gender pay gap for women of all races is driven by choices and preferences. That’s not a bad thing if it reflects what women value such as interest, fulfillment, and flexibility.

Flexibility and opportunity for women would be on the chopping block under Harris’s plan. By assuming that companies are guilty of gender pay discrimination and forcing them to prove their innocence, employers will respond in ways that minimize their liability such as not hiring as many women or removing flexible arrangements which aren’t reflected in raw pay numbers.

Many women trade a higher salary for a more flexible schedule, time off, or to work remotely. Flexibility allows them to shuttle kids to and from school, care for an aging parent, or take care of a new baby. It’s desired in the workplace. Over a thirdof workers would choose to work from home over taking a pay raise.

Women are empowered when they can negotiate for what they want in a job, whether that’s higher pay or greater flexibility, but that negotiating power would be wiped out if employers were required to treat workers exactly the same and face massive government penalties for any differences.

Harris aims to solve what is really not a problem. If a woman feels she has been discriminated against, the law is already on her side to pursue legal redress. In a great economy like this one, she can obtain better-paying opportunities. Harris would create big problems for women who value flexibility and non-traditional work opportunities.

Like many on the left, Harris is intentionally exploiting the gender pay gap to promote a liberal agenda that expands government control over the employee-employer relationship. When ideas like this win, women are the ones who will lose out.