Do we really need to litigate every school dress code in federal court? The ACLU and the National Women’s Law Center think so. They argue that rules against inappropriate attire perpetuate “gender stereotypes” in violation of Title IX, the federal law that prohibits sex discrimination in education.

Since its passage in 1972, Title IX has unleashed a flood of opportunity for women and girls in the classroom and on the playing field. Today, on almost every available metric, high school girls significantly outperform boys. Women now constitute 56 percent of students in college, where (on average) they earn better grades than men. They outnumber men in graduate school, earn a larger share of doctoral degrees, and are enrolling in both law school and medical school in greater numbers than men.

The past four and a half decades have, moreover, witnessed an explosion of women’s high school and college sports. Indeed, without Title IX, we likely would not have seen multiple US gold medal victories in women’s soccer and ice hockey.

In short, Title IX has been an incredible success. Unfortunately, however, the law that was intended to break down barriers to opportunity is now being misused to change the way students and teachers think about gender generally.

On college campuses today, activists use Title IX as a means to shut down and punish opinions that some women find “triggering.” College administrators invoke the law to investigate, without due process, the murky he-said/she-said of drunken hook-ups. And during the Obama years, the Department of Education relied on Title IX to demand that every primary and secondary school in the country allow students to use the locker-room and bathroom that aligns with their gender identity.

So how did a simple prohibition against sex discrimination morph into a labyrinth of federal mandates on everything from political speech and sex between students to high school bathrooms and dress-codes?

The answer is, in part, ideological. Despite the stunning educational progress that women have made since the 1970s, some activists believe that female students remain the victims of institutional sexism and unconscious bias. And they seek to use the power of the federal government to promote their version of social justice and change gender norms.

In his new book, “Transforming Title IX: Regulating Gender Equality in Education,” Boston College professor Shep Melnick explains this new paradigm and tells how bureaucratic overreach, congressional inertia, and unwarranted judicial deference have all contributed to its growth.

Melnick traces the way the Department of Education used “policy guidances” and “Dear Colleague” letters to broaden the scope of Title IX without legal authority or public input. Rather than pass official regulations (which require notice and public comment), unelected bureaucrats simply wrote letters announcing novel interpretations of the law.

At the same time, Education Department officials shifted from investigating specific allegations of discrimination to proactively searching for “institutional bias.” These tactics allowed the department to extract from schools far-reaching settlement agreements requiring gender-related training (read: reeducation) for their entire workforces and student bodies.

Melnick, however, does not blame the bureaucrats for the entirety of this ideological mission-creep. He also criticizes the courts (for deferring too often to the Education Department’s legally spurious interpretations) and Congress (for failing to override administrative abuses of power).

Perhaps surprisingly, Melnick is no conservative. To the contrary, he is a liberal Democrat who isn’t sure he’s “ever met a Trump voter.” But he feels strongly that rule-making by “guidance” is anti-democratic. And he does not think that manipulating Title IX is the best way to resolve new and controversial social issues.

As such, Melnick joins a growing chorus of principled liberal voices, including feminist scholar Laura Kipnis, former federal judge Nancy Gertner, legal affairs reporter Stuart Taylor, and Harvard Law professor Jeannie Suk, who have opposed the use of Title IX to chill speech, deny due process, and prevent educators from resolving controversial issues without litigation.

Hopefully, the people responsible for enforcing Title IX are listening. Title IX was passed to ensure that schools provide male and female students with equal educational opportunities, not to give kids license to dress however they please.