Qaddafi and Saddam Hussein were also very unsavory characters, but they were better than ISIS and much less of a threat to us than ISIS, its worldwide terror campaign, and goal of an international caliphate are today. The Middle East seems to need strong, authoritarian governments to keep the ISIS/Al-Qaeda types in check.
Saudi Arabia is a fundamentalist country but the government is genuinely threatened by ISIS and the Iranian theocrats, as they had been from Al-Qaeda and Bin Laden, who wanted to overthrow the house of Saud to make way for a Taliban-like pure theocracy. The pro-American government there actually does need our support to keep even worse groups from within their own country from taking power (although I do think we need to pressure them to crack down on domestic extremists much more). This is no different than our normal stance during the Cold War, when we sided with dictators and that sort when they would help us oppose the Soviets.