United Airlines on Sunday defended a gate agent’s decision to bar two young girls from a flight because they were wearing leggings, a decision that drew a wave of high-profile criticism and customer threats to end business with the airline.

The incident took place at Denver international airport and was reported by Shannon Watts, the founder of the gun safety group Moms Demand Action, on Twitter. Watts said she saw two girls stopped from boarding a flight to Minneapolis by a gate agent.

“She’s forcing them to change or put dresses on over leggings or they can’t board,” Watts wrote. “Since when does United police women’s clothing?”

According to Watts, the gate agent then said “she doesn’t make the rules, just follows them”. Watts said “a 10-year-old girl in gray leggings” who “looked normal and appropriate” was forced to change her clothing before boarding.

United did not immediately respond to a phone call or email with questions. The airline’s Twitter account, however, responded directly to Watts, saying: “The passengers this morning were United pass riders who were not in compliance with our dress code policy for company benefit travel.

“In our contract of carriage, rule 21, we do have the right to refuse transport for passengers. This is left to the discretion of the gate agents.”

The passengers were “pass riders”, the company said, defining such fliers as “United employees or eligible dependents” who fly when possible as a “company benefit”.

The passengers this morning were United pass riders who were not in compliance with our dress code policy for company benefit travel. — United (@united) March 26, 2017

“There is a dress code for pass travelers as they are representing UA when they fly,” United wrote. “Casual attire is allowed as long as it looks neat and is in good taste for the local environment.”

The company’s passenger contract says that it can bar people who are “barefoot or not properly clothed”. It does not elaborate on that description.

Watts said that the company’s behavior was “sexist and sexualizes young girls. Not to mention that the families were mortified and inconveni[e]nced”. She added: “Their father, who was allowed to board with no issue, was wearing shorts.”

Jonathan Guerin, a spokesman for the airline, told the Washington Post the girls “were not in compliance with our dress code policy for company benefit travel”.

“Our regular passengers are not going to be denied boarding because they are wearing leggings or yoga pants,” Guerin said. “But when flying as a pass traveler, we require pass travelers to follow rules, and that is one of those rules.”

Several celebrities poured scorn on United, some threatening to stop flying with the company.

“I have flown United before with literally no pants on. Just a top as a dress.” the model Chrissy Teigen wrote. “Next time I will wear only jeans and a scarf.”

Told of United’s policy for pass riders, Teigen said: “Honestly I don’t really care. If I have an issue with a company, I stop giving them money.”

The Oscar-winning actor Patricia Arquette called United’s actions “terrible” and rejected the company’s attempt to explain its policy. “Leggings are business attire for 10 year olds,” Arquette wrote in response to the explanation about “casual attire”. “Their business is being children.”

The actor LeVar Burton had a similar exchange with the company, writing: “The punitive measures taken are not a good look!”

After telling the company she might change all her upcoming United flights to other airlines, the comedian Sarah Silverman received an explanation of the company’s policy.

“I understand,” Silverman replied. “I suggest u consider updating ur rules 4 friends & fam as they seem to apply mostly 2 females & are outdated.”