Is there a wide difference between the Taliban, supposedly our sworn enemy, and Saudi Arabia, one of of our bigger allies in the region, in how they treat women and or other social issues? Not especially. In fact, Saudi Arabia assassinated a progressive who wrote for the Washington Times. Our response was basically to do nothing. While we could napalm the country, I don't think that would be that helpful to women in the region, nor impress any other country. To the extent that other countries want us to be invading and whatnot, I'm not sure that is really the case.
It seems like you are assuming that we have the freedom of action to break relations with any country we don't like. We don't.
The world is a dangerous, complicated place. If foreign relations were just a matter of being friendly with nice liberal democracies and shunning everyone else, we would hardly need any foreign policy expertise at all.
So we maintain friendly relations with repressive autocracies like Saudi Arabia. If oil were as commonplace as water, we would not need to do that, but it isn't, so we do. We nudge the Saudis on human rights, but we don't accomplish a lot.
Afghanistan is a completely different situation. Our primary interest there is keeping it from becoming a haven for terrorists. The way we have tried to do this has involved trying to uplift human rights and democratic institutions. We accomplished some good. Females in Afghanistan over the last 20 years have made tremendous progress. They have moved into the 19th or 20th century. Now they will be forced back into the Dark Ages. They will effectively be property of men.
So our failure has been a dual one. We have failed in our strategic goal to keep Afghanistan from becoming a haven for Islamist terrorists. We have failed to preserve the human rights that we introduced to Afghanistan and we have failed to protect those who bought in to what we were trying to do.
It's a disaster.
Everything that is wrong with Saudi Arabia doesn't really have anything to do with what a disaster we have suffered in Afghanistan.
It's just "whatabout" stuff, like what we see in politics every day.
Supporter of X: Look at what a slimy piece of crap Y is!
Supporter of Y: Yeah, but what about all the stupid stuff X has done?!
It just works to keep us diverted from what we need to know and ought to do.