The judge said Canyon County's claimed higher expenses for social services such as indigent medical care, schools and jails were simply the costs of being a government entity.
The lawsuit marked the first time a government tried to use the federal Racketeering and Corrupt Organizations Act to demand damages from businesses for the costs of allegedly illegal employees.
The county filed the lawsuit in July against four businesses: Syngenta Seeds, Sorrento Lactalis, Swift Beef and Harris Moran Seed, as well as against the former director of the nonprofit Idaho Migrant Council.
The four companies, which together employ hundreds of people in Canyon County, were accused of knowingly hiring hundreds of illegal immigrants, partly through agreements with worker recruiting companies.
In dismissing the case, U.S. District Judge Edward Lodge said the county's contention that the hiring of illegal aliens posed a "public nuisance" was not grounded in state law.
In addition, as a plaintiff in the RICO action, the county was not acting in a governmental capacity but as a private party to a civil lawsuit, Lodge wrote.
County commissioner and congressional candidate Robert Vasquez, a Republican, had championed the lawsuit as part of his battle against illegal immigration in Idaho.
Vasquez told CBS News correspondent Thalia Assuras in October.
Vasquez, who is of Mexican heritage, points out his grandfather came to the United States legally. He says illegal workers cost the county millions.
Canyon County is largely agricultural and many of its Latino residents work in that industry. About 19 percent of the county's 131,000 residents identify themselves as Hispanic, according to the U.S. Census Bureau.