Your question is what is a drone or satellite looking for? Off the top of my head:
Militia/armed men going into the building and staying there
Vehicles transporting militia to the building
Families going in and out - if they were truly trying their best to minimise civilian casualties
?
So what if they got intel from the ground that this was a valid site to hit (spies, binoculars), did some satellite/drone scouting that supported that claim (no refugee/civilian traffic in-and-out, because they're all inside, and the presence of ISIS forces in the area), and then made the call to hit the facility?
The only way to avoid this risk completely is to not make offensive strikes whatsoever. Could they do better overall? Yeah, absolutely - there are enough mistakes that they clearly need to change something - but there's always going to be the chance that something goes sideways like this. There's plenty of discussion to be had on whether or not drone strikes should be used - though if they weren't we'd probably still be seeing air strikes in another form - or what U.S. involvement in the region at this point should be, but regardless of the origin of the belligerents there's always a risk of this sort of thing happening, and I'd say increasingly so in Raqqa. :/