You’re also leaving out the part where the Taliban didn’t exist during the time that Afghani forces were receiving US support. If you look at the reason for getting involved in the first place, most people would agree that it wasn’t entirely unreasonable. That said if you look at how they handled the aftermath, most people would agree that part was a fuck up.
Because it's an important part of the context and explains why the US funded the Taliban.