It wasn't intentional; the building was used by the military years before. The US had really badly out-of-date intelligence and was negligent in updating it. There's absolutely no military benefit to bombing a girl's school.
Remember Hanlon's Razor, and remember how incompetent the Trump Administration has been in everything ever since he took office.