It's a mistake in the sense that if you go and rob a bank while shooting wildly, you only hit the customers "by mistake." That's not an excuse.
The US is bombing both military and civilian targets, by the way. Trump has been very open about this with his talk about "power-plant day." He considers attacking civilian targets to be a legitimate way of pressuring Iran to surrender.