Ted Cruz, in Iowa, said the military shouldn't be a "crucible for social justice innovations." (AP Photo/Charlie Neibergall)

SAC CITY, Iowa - Sen. Ted Cruz (R-Tex.) said Monday that the military's moves to include transgender soldiers in its ranks had shifted its focus away from its core mission.

The military will soon allow transgender soldiers to serve, noted Cruz. "How about having the military focusing on hunting down and killing the bad guys...instead of treating it as this crucible for social justice innovations. We’ve lost sight of what their job is and that’s what we need to get back to." Cruz asked at a stop at a restaurant here.

The Texas Republican was asked about Don't Ask, Don't Tell, a controversial policy that excluded gays from military service that ended in 2011. A man here noted that it ended under the Obama administration and wondered what would happen if Cruz were elected president.

Cruz said he would "listen to the expert judgment of the generals and admirals" on the current situation and that military policy should follow what is needed for "good order and discipline" and not social issues.

"We shouldn't view the military as a cauldron for social experiments," Cruz said.

Cruz, who is courting evangelical voters, spoke about a religious liberty rally he held in Des Moines in August. That evemt included an appearance by an Air Force senior master sergeant who said he was relieved of duty because of his religious views on marriage; Cruz said it was a "disturbing story."

The military in June announced it would allow transgender soldiers to serve openly starting in 2016. Last month President Obama nominated Eric Fanning to serve as Army Secretary. If confirmed, he would be the first openly gay civilian secretary of a branch of the armed forces.