I wouldn't say that anyone has lost Afghanistan other than the Afghani people themselves.
Hey, I'm all for not blaming people just because things happened to go wrong. Sometimes the right decisions lead to bad outcomes anyway, and sometimes people screw up and things turn out fine. Sometimes the economy is up, sometimes it's down, and it's not necessarily anyone's fault.
But I don't think that's the case in Afghanistan. As in Iraq, the most important post-war item was to provide security. We didn't do it. We didn't supply the troops necessary to do it. Instead, we diverted our resources to Iraq, where we repeated the mistake of not providing post-war security. It seems plausible to me that if we hadn't gone into Iraq, or if we had done Iraq correctly, then maybe today we'd have the troops to help root out the resurgent Taliban in southern Afghanistan.
So yes, we can say that if only the Afghanis had played nice with each other then their country wouldn't be in trouble. But it was easily foreseeable that that scenario probably wouldn't be the case (just as it was foreseeable in Iraq). For this administration to have no real plan for a less-than-optimal outcome was irresponsibility of the highest order, and as a result we're left with an outcome that's looking increasingly grim. Maybe the Afghans could have done better, but so could have this administration, and so I think it's entirely fair for them to shoulder a good portion of the responsibility for the way things have turned out.
This isn't about gloating, or my team versus their team. It's about holding government accountable regardless of who is in power. If we let these guys off the hook when they screw up, then they have little incentive to change the way they do things and they'll be more likely to screw it up the next time too.