SAN FRANCISCO (AP) — Six states lacked the legal right to challenge a California law that prohibits the sale off eggs from chickens that are not raised in accordance with strict space requirements, a federal appeals court said Thursday.

The states — Missouri, Nebraska, Oklahoma, Alabama, Kentucky and Iowa — failed to show how the law would affect them and not just individual egg farmers, a unanimous three-judge panel of the 9th U.S. Circuit Court of Appeals ruled. The court upheld a lower court decision that dismissed the lawsuit.

California voters approved a ballot initiative in 2008 that set the space requirements for egg-laying hens in the state. The standards say chickens must spend most of their day with enough space to lie down, stand up, turn around and fully extend their limbs.

The measure gave farmers until 2015 to comply.

California egg farmers raised concerns that the measure would put them at a competitive disadvantage with their counterparts in other states. In 2010, California legislators expanded the law to ban the sale of eggs from any hens that were not raised in compliance with California’s animal care standards. The California law cites concerns about protecting people from salmonella and other illnesses.

The six states argued that the law would force their egg farmers to stop selling in California or spend hundreds of millions of dollars complying with the California standard. Ninth Circuit Judge Susan Graber said that argument did not give the states standing to file suit.

“Large egg producers certainly could file an action like this one on their own,” she said.

The states also argued that the price of eggs for their consumers would change. Graber said that argument was speculative since the suit was filed before the law took effect. But even if prices went up, the states would still not have standing to challenge the law because nothing in the law directs farmers to raise prices and that eggs — unlike products such as natural gas, are not of “central economic significance” to a state, Graber said.

A call to the Missouri Attorney General’s Office, which argued the case for the states, was not immediately returned. The 9th Circuit ordered the case dismissed without prejudice, which gives the states the right to bring another lawsuit against the law in the future.

A transit village with apartments, retailers, restaurants and a hotel is rising in Milpitas next to The Great Mall, close to light rail and the under-construction BART station. It’s one of several Silicon Valley projects sprouting up near transit.