DENVER (CBSNewYork/AP) — United Airlines is getting slammed on social media after three young girls were barred by a gate agent from boarding a flight from Denver to Minneapolis because they were wearing leggings.

United spokesman Jonathan Guerin said the girls were not allowed onto the Sunday morning flight because they were traveling under an employee travel pass that includes a dress code.

That dress code bars pass travelers from wearing spandex or lycra pants such as leggings. One of the girls got on the flight after she put on a dress over her leggings. The other two were offered seats on a different plane, provided they met the clothing requirement.

But the airline’s actions sparked a backlash on Twitter. Activist Shannon Watts of Denver tweeted that she witnessed Sunday’s events and questioned United’s decision to police women’s clothing.

“We heard her say, ‘Look, I don’t make the rules. I just enforce them,'” Watts told CBS2’s Valerie Castro.

“I don’t think leggings are inappropriate for women or for girls,” added Watts, a high-profile gun-control activist who has four daughters. “And this young girl, who is 10 or 11, looked like a normal little kid.

Even celebrities reacted to the incident.

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

Actress Patricia Arquette‏ called the airline’s policy “outdated.” Star Trek vet William Shatner also blasted the rule and tweeted a throwback photo saying he’s worn tights on air crafts before.

In response, United tweeted: “In our Contract of Carriage, Rule 21, we do have the right to refuse transport for passengers who are barefoot or not properly clothed.”

The airline later clarified in another tweet, saying: “The passengers this morning were United pass riders who were not in compliance with our dress code policy for company benefit travel.”

“To our customers…your leggings are welcome!” it said an another tweet.

Pass riders are the friends and relatives of employees who get free or discounted air travel and have a more formal dress code. Some supported United in defending its policy.

“I think that if you’re flying on a friends and family pass and you know they have certain rules that you should abide by those rules,” said traveler Sharon Adams.

Guerin says ticketed passengers are not subject to the same dress code and can wear leggings.

Frank Washkuch, PR Week’s news editor, thinks the airline waited too long to get the full story out. He also said its tweets came across as defensive and uncaring.

“They bungled this one,” he said.

The dress code is no surprise to Cathy Moyer.

“I was kicked off the plane and told I couldn’t board because I had tennis shoes on,” she said. “We had to go and buy me a pair of shoes just to get on a plane, and that was in 1986, so this has been going on for a very, very long time. This wasn’t anything new.”

Moyer said it’s a small inconvenience for a free flight.

“The hoops we had to jump through then, I didn’t see a problem with it,” she said.

Many other airlines have dress codes, too, because they view employees and their families as representatives when they’re on their planes.

United said its employees are regularly reminded about the dress code for flying.

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)