The First Amendment was written in the 18th century with the noble and vitally important goal of ensuring robust political debate and a free press. For much of American history, First Amendment cases involving speech typically concerned political dissenters, religious outcasts, intrepid journalists and others whose ability to express their views was threatened by a powerful and sometimes overbearing state. The First Amendment was a tool that helped the underdog.

But sometime in this century the judiciary lost the plot. Judges have transmuted a constitutional provision meant to protect unpopular opinion into an all-purpose tool of legislative nullification that now mostly protects corporate interests. Nearly any law that has to do with the movement of information can be attacked in the name of the First Amendment.

Monday’s Supreme Court decision in the two NetChoice cases greatly adds to the problem. The cases concern two state laws, one in Florida and one in Texas, that limit the ability of social media platforms to remove or moderate content. (Both laws were enacted in response to the perceived censorship of political conservatives.) While the Supreme Court remanded both cases to lower courts for further factual development, the court nonetheless went out of its way to state that the millions of algorithmic decisions made every day by social media platforms are protected by the First Amendment. It did so by blithely assuming that those algorithmic decisions are equivalent to the expressive decisions made by human editors at newspapers.

Even if one has concerns about the wisdom and questionable constitutionality of the Florida and Texas laws (as I do), the breadth of the court’s reasoning should serve as a wake-up call. The judiciary needs to realize that the First Amendment is spinning out of control. It is beginning to threaten many of the essential jobs of the state, such as protecting national security and the safety and privacy of its citizens.

How did we get here? The reach of the First Amendment started to expand in the 1960s and ’70s, when the Supreme Court issued a series of rulings that held that the First Amendment concerned not just political and religious speech but also other forms of expression (such as sexual content) and commercial communication (such as advertisements). These initial changes to the scope of the First Amendment were reasonable.

Over the past decade or two, however, liberal as well as conservative judges and justices have extended the First Amendment to protect nearly anything that can be called “speech,” regardless of its value or whether the speaker is a human or a corporation. It has come to protect corporate donations to political campaigns (Citizens United v. Federal Election Commission in 2010), the buying and tracking of data (Sorrell v. IMS Health in 2011), even outright lies (United States v. Alvarez in 2012). As a result, it has become harder for the government to protect its citizens.