US District Judge Kathryn Kimball Mizelle said the national public health agency had exceeded its legal powers in issuing the mandate.
The US transit authority said it would now no longer enforce mask wearing.
The US Centers for Disease Control and Prevention (CDC) just last week extended the mandate until 3 May.
Judge Mizelle is based in Florida, but federal judges can issue rulings that block nationwide government policies.
Her order on Monday effectively removes the masking requirement in all airports, trains, taxis and transit hubs.
White House press secretary Jen Psaki called the decision “disappointing” and noted that the CDC still recommends travellers cover their mouths and noses.
The CDC did not immediately respond to a request for comment to Monday’s ruling.
Last week US Surgeon General Vivek Murthy said the mandate had been extended into May because of rising Covid-19 cases.
The lawsuit was first brought in July 2021 by the conservative group Health Freedom Defense Fund (HFDF) and two Florida residents who said wearing masks increased their anxiety and panic attacks.
The plaintiffs argued that the CDC mandate was “arbitrary and capricious” because it gave exemptions to certain groups – like children under two years of age – but not to others.
In her ruling, Judge Mizelle, who was appointed by former President Donald Trump, found that the CDC had improperly invoked what is known as the “good cause exception”, allowing the agency to skip public notice and comment on the mandate.
“Because ‘our system does not permit agencies to act unlawfully even in pursuit of desirable ends,'” Judge Mizelle wrote, invoking another case, “the Court declares unlawful and vacates the Mask Mandate.”
Shortly after the legal decision was issued, the Transportation Security Administration – which runs US airport security – confirmed it would no longer enforce the mask mandate.
United Airlines, Delta Air Lines, Alaska Airlines and American Airlines said face coverings would no longer be required on domestic flights and certain international flights.
Since the CDC first issued a public health order in February 2021 requiring masks for travellers, more than 7,000 unruly passenger incidents have been reported – 70% of them involving masking rules, according to the Federal Aviation Administration.
The Biden administration’s Covid-19 mandates have had mixed success in the court system.
The Supreme Court in January blocked the White House from enforcing its sweeping vaccine-or-test rule for employees at large private companies.
But the Biden administration’s requirement that all federal employees be vaccinated against Covid-19 was upheld on appeal earlier this month.