You are conflating what the US considers enemies before targeting and after a strike. The US doesn't just bomb any random male 18-49.
But when the US does target what it thinks is a legitimate target, it counts any unknown males killed in the strike as enemy. It doesn't use that assumption to do the strike. Only to count the enemy v. civilian kill total.
And it's a pretty reasonable assumption, depending on the circumstance. If the US drone strikes a Taliban hide out, the unknown males there were very likely foot-soldiers of the Taliban. If you accidentally blow up a wedding, then counting all the men is essentially lying.
But your sex and age don't make you a target. You being near a target doesn't really make you a target either. It makes you a tragic accident.
Unless the Taliban want to line up like 18th century foot soldiers, there are going to be people killed who aren't involved. Sending in ground troops would only make it worse.
And it's not like the Taliban aren't a real threat to Afghanistan. They just took over the 5th largest city in Afghanistan two weeks ago.