Undated picture showing Fair Oaks Farms in Indiana, a dairy farm and agricultural tourism attraction. Three former workers have been charged in connection with an ongoing animal cruelty investigation by the Newton County Sheriff's Office. It follows the release of undercover video showing alleged abuse of calves at the farm.

The controversy over video showing alleged abuse of calves at a farm in Indiana is calling attention to so-called ag-gag laws on the books in at least seven states.

Ag-gag statutes are aimed at keeping out animal activist groups such as People for the Ethical Treatment of Animals from secretly videotaping and photographing livestock operations. Several such laws have been challenged in the courts and found to be unconstitutional, including in Utah, Idaho and Iowa.

"The animal agriculture industries have been trying to pass these laws for years now," said Richard Couto, founder of Animal Recovery Mission, the nonprofit animal welfare group that shot the Indiana video. "If that law was put into place in Indiana, we wouldn't have been able to go in and video the cruelty."

The farm at the center of the flap is Fair Oaks Farms, one of the nation's largest dairies. The farm is one of 30 suppliers of milk to Fairlife, a national brand distributed by Coca-Cola.

A co-founder of Fair Oaks Farms is Mike McCloskey, a veterinarian who advised the 2016 presidential campaign of President Donald Trump and last fall visited the White House. McCloskey was mentioned in 2016 as a contender for secretary of Agriculture, according to Politico.

The undercover video shot by ARM appears to show neglect and abuse of newborn animals by several workers at the farm, including calves being punched and dragged. The video was released last week and runs about four minutes.

Three former workers of Fair Oaks Farms have been charged in connection with the ongoing animal cruelty investigation, according to the Newton County Sheriff's Office.

Several attempts to pass sweeping ag-gag bans in Indiana have failed, including one in 2013 that would have criminalized filming of farms or other businesses without the permission of the property owner. That legislation was defeated amid concerns it violated the First Amendment.

Even so, Indiana lawmakers returned in 2014 with legislation that toughened penalties against trespassing rather than outlawing undercover filming at a farm. It applies to agricultural and other businesses and was signed into law in 2014 by then-Gov. Mike Pence.

Indiana Sen. Travis Holdman, the Republican state lawmaker who introduced the 2013 ag-gag legislation, claims the undercover video was politically motivated, according to the Times of Northwest Indiana newspaper. He also wouldn't rule out reintroducing similar legislation but suggested he would reach out to the industry for input.

The ARM investigator who shot the video worked undercover at Fair Oaks Farm. As a result, experts suggest there was no violation of the state's current trespass law.

Gabriel Walters, an attorney for PETA, said there's only been one attempted prosecution under state ag-gag laws, and it involved an animal rights advocate filming a slaughterhouse from a public street. A federal judge struck down Utah's law in 2017, finding the bill was a violation of free-speech protections guaranteed by the Constitution.

Similarly, ag-gag statutes in Idaho and Iowa previously were found to be unconstitutional. A law in North Carolina also is facing a legal challenge.

Iowa's ag-gag law, enacted in 2012, was overturned by a federal judge in January. State lawmakers didn't waste much time, moving two months later to pass a new facility trespass bill that criminalizes the use of deception to enter an agricultural production business to cause an "injury" to the entity.

Fair Oaks Farms is an agricultural tourist destination and features educational tours where schoolchildren and others can learn about farm animals.

"We wanted to see if the company was lying to the public," Couto told CNBC. "In the first hour we were employed there, horrific animal abuse started."

McCloskey didn't reply to a CNBC request for comment, but he issued a response in a Facebook post and said he takes full responsibility for the actions seen in the footage since "it goes against everything that we stand for in regards to responsible cow care and comfort."

He added, "It is a shock and an eye-opener for us to discover that under our watch, we had employees who showed disregard for our animals, our processes and for the rule of law."

According to McCloskey, several employees were let go in connection with the "multiple instances of animal cruelty and despicable judgement." He also pledged that the farm would allow independent, unannounced and random audits.

At least three retailers, including Midwest grocer Jewel-Osco, have pulled Fairlife milk from their shelves.

"We were appalled and deeply saddened to learn of the abuse by several Fair Oaks Farms employees, who are now under criminal investigation," Fairlife CEO Mike Saint John said in an online post. "Such acts will not be tolerated, and we have taken immediate action to address the situation and to protect animals at all supplying farms."

At the same time, there have been protests by animal activists outside Coca-Cola headquarters in Atlanta.

Coca-Cola said last week in a statement that Fairlife discontinued use of milk from Fair Oaks Farms and added, "Any form of animal cruelty is unacceptable and against our values."