Turkey gives NATO an very valuable geopolitical position, with leverage as the most powerful nation in the Mideast neighborhood, as well as dominating the Black Sea and eastern Mediterranean, and providing a position on the southern flank of Russia, eastern flank of the Balkans (less essential post-Cold War), and a stable border with countries to the east and south. Turkey as an enemy would be a serious headache.
Qatar and especially Saudi Arabia, the wealthiest and most powerful Arab state, give the U.S. leverage and stability (at least for decades until recently) in the Mideast, which, due to the oil supply, is essential to world peace and prosperity. They also counter-balance to Iran.
Those benefits don't necessarily justify supporting oppression, but those are very serious considerations.