It was recently revealed that 10-15 American SOCOM (Special Operations Command) personnel were reprimanded for not realizing that they were hitting the wrong target when called in by U.S. Army Special Forces on the ground who were handling air support for Afghan troops in late 2015. International aid organization were demanding a criminal investigation and some senior American politicians were inclined to go along. But someone with recent combat experience in Afghanistan was able to explain that in a battle like this (the Taliban had seized most of the city a week earlier by bribing a lot of police and scaring the rest away) there is a lot of confusion and uncertainty and that the American and Afghan troops were under pressure to take the city back as soon as possible. So the compromise was to issue letters of reprimand to the enlisted personnel and lower ranking troops involved. The goal here was to avoid doing serious damage to the morale of SOCOM personnel in Afghanistan who are under fire on a regular basis. The real crime here was corruption in Afghanistan (which is ranked as one of the five most corrupt nations on the planet) which makes it easy for the Taliban, or anyone else, to bribe just about anyone. The corruption regularly gets lots of Afghans (civilians, soldiers and police) and foreign troops (mostly Americans) killed and no one gets any publicity, much less punished, for not stopping it, or even admitting it is the underlying cause of problems like the chaos at Kunduz.
This October 3rd 2015 incident in Kunduz was described in the media as Afghan forces calling in American air support against Taliban who were firing on them from a building near a hospital. An American AC-130 gunship responded. Despite the precision of the AC-130 fire (211 30mm shells in 29 minutes) 22 civilians died because the Taliban were operating in the midst of civilians (a favorite tactic to prevent air strikes) and were actually in a nearby building rather than the building being fired on. It took half an hour before that information got to the AC-130, which ceased fire. This became a major news story. Right after the incident the commander of U.S. forces in Afghanistan ordered all troops under his command to be formally reminded of the ROE (Rules of Engagement).
The Kunduz incident resulted in more strict application of the ROE and a lot less U.S. air support for Afghan troops and police. This makes the security forces less effective and the Taliban more so. This sort of thing is no accident. The Taliban and drug gangs have invested a lot in the local media, to make each civilian death, at the hands of foreign troops, a major story. The majority of civilian combat deaths are at the hands of the Taliban or drug gangs, and the local media plays those down (or else). It's a sweet deal for the bad guys, and a powerful battlefield tool. The civilians appreciate the attention, but the ROE doesn't reduce overall civilian deaths, because the longer the Taliban have control of civilians in a combat situations, the more they kill. The Taliban regularly use civilians as human shields, and kill those who refuse, or are suspected of disloyalty. In most parts of Afghanistan, civilians are eager to get the Taliban killed or driven away, as quickly as possible and by any means necessary. The number of civilian deaths, at the hands of NATO/Afghan forces, are spectacularly low by historical standards. The U.S. armed forces have reduced civilian casualties during combat by over 90 percent since the 1970s. This is the result of wider use of precision weapons, better communications and new tactics. The troops know this, some of the civilians know this, but the media doesn't care and the Taliban know that dead Afghan soldiers and police are not news but dead civilians are, especially if it is one of rare incidents where the Taliban was not responsible.