This article was produced in partnership with the Charleston Gazette-Mail, which is a member of the ProPublica Local Reporting Network.

The Republican-led West Virginia House of Delegates received national attention last week for impeaching all four of the state’s sitting Supreme Court justices. Lawmakers cited a swirling scandal over court spending that ranged from using state cars for personal business to extravagant office renovations that included a $32,000 couch.

Among the targets was Beth Walker, who was impeached over allegations of irresponsible spending and poorly managing the court’s administrative affairs.

But left unmentioned in the impeachment and the debate around it has been a peculiar vote by Walker that benefited the natural gas industry. In one of her earliest votes, Walker made a highly unusual decision to reopen a case and then reverse a Supreme Court ruling that would have forced drillers to pay more in profits to residents. Walker voted to reopen the case around the time her husband owned stock in a variety of energy companies, including those participating in West Virginia’s growing gas boom.

The case focused on whether natural gas companies are allowed to deduct a variety of expenses — for the transportation and processing of gas, for example — when they calculate payments for West Virginia residents or companies that lease them drilling rights to their gas. Millions of dollars in gas royalty payments, the riches from the industry’s dramatic growth in West Virginia over the past decade, were at stake.

The Daily Digest Get the latest news from ProPublica every afternoon.

In November 2016, the court — before Walker joined it — voted in favor of the residents, ruling that producers weren’t allowed to take such deductions.

Two months later, just weeks into her term, Walker provided the pivotal vote to have the court reconsider the ruling. The court then overturned it, siding with the industry and against the residents.

The decision has been a source of significant dispute. This year, lawmakers passed a bill to reverse the court’s second decision. That prompted EQT Corp., the state’s second-largest gas producer, to file a lawsuit in federal court challenging the Legislature’s action, as well as a 36-year-old state law that sets minimum royalty payments for new gas wells. The company said the state law “infringes on EQT’s vested drilling rights” under its leases.

That case is pending in U.S. District Court in Clarksburg and is among the major battles playing out amid the economic shift in West Virginia from coal to natural gas.

Land ownership across West Virginia has often been complex and confusing. Someone may own the surface land, while someone else owns the the coal, oil or gas underneath it. Tracts such as natural gas reserves become divided among multiple owners, as land and minerals are passed down across generations.

Much of the natural gas in West Virginia is produced under leases that are decades or more than a century old. When they were signed in the early 1900s, paying residents and mineral owners $100 to $300 a year for gas was considered reasonable, maybe even generous. Most drillers at the time were after oil. Gas was mostly an undesirable byproduct.

When the market for natural gas increased, it became more common for leases to pay a share of the sales. Residents and others owning the mineral rights would make more money as production increased.

But many West Virginians were stuck with older leases paying a set amount per year, regardless of production. The Legislature decided to step in with a bill in 1982 to increase royalty payments for new wells drilled under older leases. While existing wells were grandfathered in, new wells drilled under those old leases would now have to pay the gas owner at least 12.5 percent of the gas sales price.

It was one of these leases, signed in 1906, that governed the deal between Patrick and Katherine Leggett and EQT, and that led to the case involving Walker.

The Leggetts were supposed to be getting a 12.5 percent royalty on the gas produced from the new wells on their land. But they were actually getting much less, because EQT was taking deductions from their payments for expenses incurred after the gas was extracted.

The Leggetts and their lawyers thought the law was clear: West Virginia courts had already ruled that gas firms couldn’t take deductions unless leases explicitly allowed them. And the 1982 royalty law didn’t mention allowing deductions. (The Leggetts were represented by Charleston lawyer Marvin Masters, who is among a group of local investors who bought the Charleston Gazette-Mail this year.)

EQT, though, argued that the Leggett case was different, because the court was interpreting the 1982 statute, rather than simply deciding a dispute over the language of a gas lease.

So EQT and the Leggetts went to court, and the case ended up before the state Supreme Court — at a very unusual time.

In May 2016, Walker, a Morgantown lawyer, had just won a seat on the five-member Supreme Court. Still, Walker wasn’t scheduled to take her seat until Jan. 1 and wouldn’t be hearing the Leggett case.

The case was decided in November 2016 by a 3-2 opinion written by Brent Benjamin, the justice Walker had defeated a few months earlier. It affirmed that gas companies couldn’t take post-production costs out of the royalties they paid to people like the Leggetts. The ruling was published on Nov. 17, 2016, the last day of the court’s fall term that year.

When Walker was sworn in a few weeks later, one of her first acts was to join the two justices who had voted against the Leggetts — Allen Loughry and Menis Ketchum — to rehear the case, at the request of EQT. The court rarely agrees to rehear cases, and the court’s own rules say this can only be done in “exceptional cases,” where the court has “overlooked or misapprehended” points of law or fact.

Read More West Virginia Paid for a CEO to Go on a Trade Delegation to China. Turns Out, He Was Promoting His Company’s Interests, Too. An executive accompanied state officials to China for a ceremony with President Donald Trump to sign a landmark deal last year. He also pushed his company’s interests, which the governor said Friday was not acceptable.

The Leggetts’ lawyers argued that Walker should not be involved in the case and should never have voted on whether to rehear the case because of her husband’s holdings in industry stock.

Mike Walker had loaned his wife’s campaign $525,000 during the 2016 election, according to campaign finance reports. Financial disclosures Beth Walker filed as a candidate for the court indicated that Mike Walker owned stock in many natural gas and energy companies, including Chevron, Columbia Pipeline Group, ConocoPhillips, Dominion Resources, Duke Energy, General Electric, Portland General Electric and ExxonMobil, whose subsidiary, XTO Energy, has significant operations in West Virginia. (State disclosure forms do not provide dollar amounts or ranges for such holdings.)

In court filings, the Leggetts’ lawyers said the loans from Walker’s husband accounted for 70 percent of her campaign funds, and that his energy stocks created a conflict of interest for her in the royalties case.

The decision on whether a justice should be recused is left up to the justice, and Walker declined to recuse herself.

First, she issued an April 26 memo that said she found “no basis for my disqualification” because “neither I nor my husband has an economic interest in the subject matter in controversy.”

Then, five days later, just a day before an oral argument to rehear the case, Walker issued a second memo that said, “Out of an abundance of caution, my husband has divested himself of ownership of shares of stock of any company engaged in the business of producing coal, oil and gas, wind or solar energy.”

At the time, Walker declined through a court spokeswoman to say exactly when her husband sold his energy stocks or if he sold them before she voted to rehear the case. On Friday, Walker’s attorney declined to answer that question or otherwise comment.

In later court filings, EQT lawyers noted that it wasn’t clear how much energy stock Mike Walker owned and said his holdings represented a “diverse stock portfolio, with investments in many different industries.”

Lawyers for the Leggetts describe the stock sale as having taken place after Beth Walker voted to rehear the case. EQT lawyers said what mattered was that the stock divestiture occurred before Beth Walker took part in the oral arguments and decided on the merits of the case.

Three weeks after the new oral arguments, the court sided with EQT over the Leggett family: Post-production costs could be taken from leases covered by the 1982 law.

After that ruling, lawyers for the Leggetts tried to take the issue of Walker’s involvement to the U.S. Supreme Court. But that court declined to hear the matter, as it does with the vast majority of appeals filed every year.

When West Virginia justices reversed the decision in the Leggett case, they acknowledged that they had created a situation in which some gas owners would have post-production costs deducted from their royalties and others would not, based on when their leases were written and when their wells were drilled.

“We therefore implore the Legislature to resolve the tensions as it sees fit,” the court said.

In their 2018 annual session, which began in January, legislators wasted no time in taking the court’s advice and approving a bill to undo the court’s second Leggett decision.

The state Senate approved the bill unanimously, and the House did so by a vote of 96-2. Gov. Jim Justice signed it on March 9, with an effective date of May 31.

Before the bill took effect, though, lawyers for EQT filed suit in Clarksburg challenging the measure and seeking to have the entire royalty statute thrown out. The state is seeking the suit’s dismissal.

“The state is meddling in private contracts because the Legislature prefers one party to the other,” EQT lawyers wrote in a legal brief. “In other words, West Virginia decided that the lessors had not made lucrative enough deals and simply shifted the fruits of the bargain to them.”

The Senate will hold a trial in coming weeks to determine if Walker and the other justices should be removed from office.

Walker is mentioned in only one of the formal articles of impeachment approved by the House, which lists all of the justices and summarizes complaints about the court’s use of public funds.

A more specific impeachment article outlining Walker’s own spending on office renovations was rejected by the GOP-controlled House. Another amendment, to add a specific charge about Walker hiring an outside lawyer to write a court opinion, was also rejected by the House. An effort to remove Walker’s name altogether failed.

In a prepared statement after the House impeachment vote, Walker said that, in her short time as a justice, she had been “committed to greater transparency and accountability in the judicial branch.”

“I agree that expenditures prior to my election were ill-advised, excessive and needed greater oversight,” Walker said.

The five-member court already has lost two members; another has been suspended.

Ketchum retired last month, and he subsequently agreed to plead guilty to one federal count of wire fraud. He was charged with using a state vehicle to take multiple trips to a golf club in Virginia.

Then, last week, after the House impeachment vote, Justice Robin Davis announced that she was retiring. Davis criticized the impeachment process, saying House Republican leaders were attempting “to dismantle a separate branch of government.”

Loughry, whose spending practices prompted investigations of the court in the first place, was indicted in June on federal charges of fraud, making false statements and witness tampering. Loughry has pleaded not guilty, and his criminal trial has been set for early October. In the meantime, he has been suspended from the court.

The Senate is meeting today to set its schedule for trials for Walker, Loughry and Chief Justice Margaret Workman that could remove them from office. In the meantime, Walker and Workman remain active on the court, as does a temporary justice Workman appointed to fill in for Loughry. Workman has said there “is no basis” for her impeachment, and that she looks forward “to putting all the facts before the Senate in the next phase of this process.”

Whatever the ultimate composition of the court, additional natural gas cases await it.

Another group of West Virginia residents is asking the court to overturn the dismissal of a major lawsuit alleging that the state’s largest producer, Antero Resources, is creating a nuisance with its natural gas operations — with unbearable traffic, mountains of dust, constant heavy-equipment noise and bright lights that shine into their homes day and night.

Oral arguments are scheduled for Sept. 5.

Read More Covering West Virginia’s Long History of Broken Promises In the face of a major decline in the coal industry, families and entire communities that depended on it are hurting. Now that natural gas is booming, I’m reporting on whether we’ve learned anything from the past.

The Charleston Gazette-Mail and ProPublica want to tell the story of the changing landscape in West Virginia, and how coal and natural gas are impacting it. West Virginians: Tell us how your community is changing. Call or text us at 347-244-2134, or email us: [email protected]. Ken Ward Jr. covers the environment, workplace safety and energy, with a focus on coal and natural gas, for the Charleston Gazette-Mail. Email him at [email protected] and follow him on Twitter at @kenwardjr.