Nockamixon and six other municipalities, including Yardley Borough, challenged the law that took effect in April. Two elected officials, a doctor, the Delaware Riverkeeper Network, and that group's leader also were plaintiffs in the suit.
"The court has recognized that the Pennsylvania legislature and Gov. Corbett went too far," said Jordan Yeager, the lawyer for the two Bucks towns and the environmental group. "This is a great victory for the people of Pennsylvania, for local democracy, for property rights, for our public health, and for the clean-water supplies on which we all depend."
Act 13 was enacted to collect impact fees from drilling companies tapping the vast natural-gas supplies in the Marcellus Shale region. Pennsylvania had been the only major gas-producing state that did not tax natural-gas production, and it was projected to collect $175 million this year.
Although Act 13 was designed for tapping the Marcellus Shale reserves, which lie beneath two-thirds of the state, the law governs the drilling, storage, and transporting of oil and natural gas throughout Pennsylvania.
The law allowed drilling within 500 feet of buildings and water wells; within 300 feet of springs, rivers, and wetlands larger than an acre; and within 1,000 feet of sources of public drinking water. Compressor stations could operate in agricultural and industrial districts, and processing plants were allowed in industrial zones.
That was an improvement from the previous law, supporters of the law say.
But it required towns to allow drilling in all zoning districts, opponents said. And it required towns to amend their zoning laws within 120 days to comply with Act 13 or lose any impact fees.
The court also ruled against the state Department of Environmental Protection's ability to waive setback requirements for well sites.
It rejected eight of the petition's 12 issues, including a challenge of the state's power of eminent domain. It also ruled that the Delaware Riverkeeper Network and the three individuals did not have standing in the case.
The majority of the seven-judge panel that ruled against the act included Pellegrini, a Democrat, who was joined by the other Democrat, Bernard McGinley, and two Republicans, Patricia McCullough and Bonnie Brigance Leadbetter. Three Republican judges dissented.
"The law promotes the health, safety, and welfare of all Pennsylvanians by establishing zoning guidance to local municipalities that ensures the uniform and optimal development of oil and gas resources in this commonwealth," Judge Kevin Brobson wrote for the minority.
Corbett's office said in a statement: "We will vigorously defend this law, which better protects the environment, provides revenue to local communities, and regulatory certainty to both landowners and job creators."
Officials from the state Public Utility Commission and the state Attorney General's Office, which defended the law, said they were reviewing the ruling.
A lawyer for Senate President Pro Tempore Joe Scarnati, (R., Jefferson), who helped write the law, said he expected the decision to be appealed to the Supreme Court.
The head of the Marcellus Shale Coalition said the law was enacted "to provide certainty and predictability that encourages investment and job creation across the commonwealth."
"Lack of uniformity has long been an Achilles' heel for Pennsylvania and must be resolved if the commonwealth is to remain a leader in responsible American natural-gas development and reap the associated economic, environmental, and national security benefits," coalition president Kathryn Z. Klaber said in a written statement.
State Rep. Tim Briggs (D., Montgomery), who was among 30 House Democratic lawmakers who filed a special legal brief in May supporting the suit, praised the ruling.
"Environmentally, this new law seems almost designed to repeat the devastation left by the coal barons 100 years ago," Briggs said in a statement. "It essentially placed the environmental health of the entire state into the hands of industrial gas drillers."
Earlier this year in New York State, courts twice ruled in favor of towns that limited industrial gas development through local zoning, said Deborah Goldberg, managing attorney for the nonprofit environmental law firm Earthjustice.
"For the third time this year, state courts have recognized that local municipalities have rights that must be respected when industrial activities are proposed for their communities," Goldberg said in a written statement. "Today's ruling gives encouragement - and firm legal backing - to Pennsylvania communities daring to stand up to the oil and gas industry with local zoning laws."
Contact Bill Reed at 215-801-2964 or email@example.com, or follow on Twitter @breedbucks. Read his blog, "BucksInq," at www.philly.com/bucksinq.
This article contains information from the Associated Press.