The Associated Press alleges that US Special Forces intentionally called in an airstrike on the Kunduz hospital, knowing it was a hospital (albeit one erroneously associated with the Taliban).
Also a mystery is why the AC-130 gunship would have kept firing during the course of an hour on a building that both the Air Force and the Army knew was an internationally run trauma center. To avoid civilian casualties, a gunship would typically stop firing as soon as it achieved its objective — in this case, ostensibly, protecting U.S. forces. Generally, the aircraft would require further clearance from the troops on the ground to continue firing.
An AC-130 gunship flies low and slow, often with a good view of its target and the damage it is inflicting. The pilot also would have had to know the locations of U.S. and allied forces in the area, to avoid hitting them.
We previously discussed this airstrike on a radio episode: Oct 14, 2015 – Arsenal For Democracy Ep. 146