WASHINGTON — President Trump ended a losing streak in court clashes with the House on Monday, as a federal judge rejected the Democrat-controlled chamber’s lawsuit seeking to stop him from using emergency powers to build a wall along the southwestern border.

U.S. District Judge Trevor N. McFadden denied a House request to temporarily stop spending on the wall, saying the House lacked legal standing to sue the president for allegedly overstepping his power by diverting billions intended for other purposes to pay for it.

“While the Constitution bestows upon Members of the House many powers, it does not grant them standing to hale the Executive Branch into court claiming a dilution of Congress’s legislative authority,” McFadden, a 2017 Trump appointee, wrote in a 24-page decision. “The Court therefore lacks jurisdiction to hear the House’s claims and will deny its motion.”

The ruling will not have any immediate practical consequences because other groups have already secured an order blocking President Trump from proceeding. But if other courts accept Judge McFadden’s reasoning, the House’s litigation options will narrow as it battles the president on several fronts.

Rulings from trial judges do not set binding precedents, however, and Judge McFadden’s ruling did not concern subpoenas issued by the House seeking information from the administration. He said a different legal analysis applied to disputes arising from such subpoenas.

President Trump declared a national emergency in February to try to gain access to billions of dollars after Congress refused to give him money to build a wall. Last month, Judge Haywood Gilliam of the United States District Court for the Northern District of California entered a preliminary injunction that stopped the administration from redirecting funds under the emergency declaration. Judge Gilliam was appointed to the bench by President Barack Obama.

The decision is at odds with a May 24 ruling by a federal judge in California that temporarily blocked part of the plan because it was using money Congress never appropriated for that purpose.

The cases in California were brought by private groups that did not face the standing issue in the case decided Monday.

A central issue for both courts is whether diverting the funds is an illegal act that violates the constitutional separation of powers between branches of the government. Both challenges were brought shortly after the president declared a national emergency along the southern border, but the plaintiffs in California included border communities and environmental groups.

The judge in Washington never touched on the merits of the Democratic-led House’s claim, ruling instead that a single chamber of Congress had “several political arrows in its quiver” remaining to address disputes with a president and could not show that it needed courts to intervene as “a last resort.”

McFadden granted that the case “presents a close question” and added that his ruling “does not imply that [the full] Congress may never sue the Executive to protect its powers.” Still, he said, the Constitution provides the House other levers to use against the executive, including specifically denying funds, passing other legislation, conducting hearings and investigations, or overriding a president’s veto.

Judge McFadden ruling’s is in tension with a 2015 decision from Judge Rosemary M. Collyer, who also sits on the Federal District Court in Washington and was appointed by President George W. Bush. Judge Collyer ruled that the House, then controlled by Republicans, had standing to challenge spending under Mr. Obama’s health care law, the Affordable Care Act.

At the time, lawyers for the House argued that suing the White House was the only way to preserve its constitutional power to control federal spending and stop the administration from distributing $136 billion in insurance company subsidies.

Judge McFadden limited the sweep of his reasoning in one respect, saying courts may weigh in on disputes between the other two branches arising from congressional subpoenas.

“Using the judiciary to vindicate the House’s investigatory power is constitutionally distinct,” he wrote, adding that “the investigatory power is one of the few under the Constitution that each house of Congress may exercise individually.”

“It is perhaps for this reason,” he wrote, “that the House’s power to investigate has been enforced with periodic help from federal courts.”