TL;DR
Not directly related to the movie, but there are instances of feral animals becoming a concern and actions taken to change this, and it is not isolated and there is policy for it.
Why would they have no else way, than to shoot the stray animals ?
Is there any other military technical detail that I missed here.. ?
In times of peace, or certainly not when being shot at, as you can see, there are other ways of dealing with them.
So, the official line is such practices as adopting stray animals as pets are prohibited, and you could be punished for it.
In theater, there is a perceived fear of word getting out and an order coming down to destroy said adopted pets as a matter of policy.
But the writers for the film are likely to have heard bits and pieces from people here and there and would have put together a line that made it seem like a reason to get mad at the military by this particular character in that movie.
The following is a sample of articles related to the shooting of feral animals on bases.
This was a letter setting out policy on a US Naval base:
https://www.denix.osd.mil/dodpif/resources-and-information/about/unassigned/policy-letter-preventing-feral-cat-and-dog-populations-on-navy-property/Navy_feral_cat_policy.pdf

So according to this example, free roaming feral animals are prohibited on base. Feeding of said feral animals is prohibited too. To remove them is to prevent injury or disease to base personnel, and avoid adverse impact on local wildlife. They are seen as a health threat. But policy in this instance is TNR: trap, neuter and release.
There is also this article:
https://www.thedodo.com/ex-soldier-explains-dog-photo-1323256712.html

Extract from the letter the former soldier posted to facebook:
...at the time this picture was taken feral dogs where out of control in Afghanistan, soldiers where being bit and infected and in a lot of areas we just did not have the resource to treat someone. Vets where flown in across the region to capture and euthanize dogs for the safety of our troops.
There is a whole manual issued by the U.S. military that gives rough guidelines on dealing with stray animals, and recognizes that in some areas units will decide to put in place a policy to euthanize stray animals:
"Euthanizing a stray animal can, on occasion, be considered a
humane action. It is always the last resort and should be practiced
only when rescue and adoption are not possible"
Further on in the article:
"We where told not to shoot the dogs unless we had no other choice, backed into a corner with no where to escape kind of deal...... They didn't want any spread of disease through the blood that would come from shooting one.
I believe some policy documents would be found here in these links but i have trouble accessing them:
Armed Forces Pest Management Board
https://www.acq.osd.mil/eie/afpmb/technical_guidance.html
https://www.stripes.com/theaters/middle_east/bases-going-to-the-dogs-and-cats-1.128367
While no one will say so officially, it appears commanders recognize the value that pet dogs and cats bring to the morale of a base, so they look the other way as long as the animals do not interfere with the mission or present health concerns.
In 2000, U.S. military General Order 1A was issued, "To identify conduct that is prejudicial to the maintenance of good order and discipline of all forces in war zones."
More than 20 activities are listed as prohibited, including having sex with a foreign national, drinking alcohol, looking at pornography or removing national treasures. Another prohibited activity (punishable under the Uniform Code of Military Justice) is, "adopting as pets or mascots, caring for, or feeding any type of domestic or wild animal."
when a Stars and Stripes reporter recently started making inquiries about getting photographs of stray dogs accompanying troops on patrol, soldiers at one base made a point of not taking the animals with them outside the wire. They said they were afraid someone high in the chain of command might order the killing of on-base pets if the widespread practice were publicized.
https://www.koreaherald.com/view.php?ud=20220524000633
Shooting of stray cats by US troops causes controversy
Osan Air Base has been catching stray cats entering its territory since the beginning of last year to ensure the safety of planes taking off and landing in the area and to prevent the spread of infectious disease.
“From April 2021, the pest management team took cats to the veterinarian in the base, and then cats were euthanized at the veterinary hospital,” the informant said.
Since July last year, the method of slaughtering has changed to shooting because euthanasia drugs are expensive and veterinarians can be traumatized, the informant added.
https://www.motherjones.com/politics/2010/06/iraq-kbr-one-million-dogs-death/
Wild animals also pose special problems for American service members in Iraq. Despite the fortifications at the US coalition’s largest bases—mazes of walls, cameras, guns, checkpoints—coyotes and cats slip through at will, often crossing soldiers’ paths in the dusty dark of night, catching fish on base lakes and moats, or tracking rats underneath the soldiers’ sleeping trailers. >
Rabies is an ever-present concern, as is the general nastiness of the feral animal population.
Plus, military working dogs are ubiquitous in Iraq, and keeping them away from wild animals is a paramount concern. Units that rely on working animals have rules of engagement empowering them to kill any creature that ventures too close to their dogs.
A week before Cummings and his unit were set to return home, orders came down to dispose of all adopted animals on the base before the incoming unit’s soldiers arrived. “The day our full-bird colonel and his replacement came on a battlefield tour, suddenly all the dogs were gone,” he writes. “I assumed they had been taken to the trash pit and executed, the fate of many dogs downrange.