On a 9-0 vote, the court said the 2007 law violated freedom of speech rights under the U.S. Constitution's First Amendment by preventing anti-abortion activists from standing on the sidewalk and speaking to people entering the clinics. The law allowed only patients, staff, passersby and emergency services to enter the 35-foot (11-metre) zone.
The ruling casts into doubt similar fixed buffer zones adopted by several municipalities around the country, including San Francisco and Pittsburgh. The court did not specify under what circumstances other types of restrictions aimed at keeping public order outside clinics would be deemed lawful.
The court sent a signal that some laws might be acceptable by declining to overturn its ruling in a 2000 case that upheld a less restrictive law in Colorado. That law prevents people outside clinics from approaching within 8 feet (2-1/2 meters) of another person without their consent. Montana has a similar law.
The Massachusetts law was enacted in part because of safety concerns highlighted by violent acts committed against abortion providers in the past. In 1994, two abortion clinic workers were killed outside a clinic in Brookline, Massachusetts.
The protesters say their main aim is to counsel women to try to deter them from having abortions.
Although the court did not say buffer zones are always unconstitutional, the decision could make it more difficult for states to pass similar laws in future, said Marcia Greenberger, president of the National Women's Law Center.
Thursday's decision could give Massachusetts a chance to fashion a new state law.
Eleanor McCullen, the abortion protester who was the lead plaintiff in the case, welcomed the decision saying it allows her to "offer loving help to a woman who wants it" without facing the threat of jail.
Abortion rights activists criticized the court. "This decision shows a troubling level of disregard for American women," said Cecile Richards, president of Planned Parenthood Federation of America.
The group said it plans to seek other ways of ensuring public safety at its three clinics in Massachusetts that offer abortions, in addition to other health services for women.
Massachusetts Attorney General Martha Coakley said in a statement that "with today's decision, our work begins again. We are not going to give up our fight to make sure women have safe access to reproductive health care" and use "all of the tools we have available to protect everyone from harassment, threats, and physical obstruction."
Coakley said her office would work with the governor, legislature and advocates on "legislative tools that also meet the court's requirements."
In the majority opinion, Chief Justice John Roberts said no other state has a fixed buffer zone law like Massachusetts. The law was unconstitutional because it was not narrowly tailored in a way that took into account the free speech rights of protesters, he wrote.
The state has "too readily foregone options that could serve its interests just as well, without substantially burdening the kind of speech in which petitioners wish to engage," Roberts wrote.
The fixed nature of the buffer meant that protesters would have difficulty approaching women entering the facility who they wish to engage in conversation, Roberts said.
McCullen is often forced to raise her voice in order to be heard, Roberts noted, which is "a mode of communication sharply at odds with the compassionate message she wishes to convey."
Although unanimous on the outcome, some of the justices differed on their legal reasoning. Three of the conservative justices said they would have overruled the 2000 precedent, an outcome that would have cast other buffer zones into doubt.
"Protecting people from speech they do not want to hear is not a function that the First Amendment allows the government to undertake in the public streets and sidewalks," Justice Antonin Scalia wrote in a concurring opinion.
Abortion remains a divisive issue in America. The Supreme Court in its landmark 1973 Roe v. Wade ruling legalized abortion. In recent years, some Republican-governed states have sought to impose new restrictions on abortion.
In a January 2013 ruling, the 1st U.S. Circuit Court of Appeals in Boston upheld the Massachusetts law, prompting the challengers to seek Supreme Court review.
The case is McCullen v. Coakley, U.S. Supreme Court, No. 12-1168.