Carter BETRAYED the Shah because the Shah was no longer being an OPEC puppet. He was hiking oil prices during a time of economic weakness in the West, and he was starting to put Iran first, hence why Carter's administration supported Khomeini as an alternative:

http://www.wikileaks.org/plusd/cables/1975STATE163771_b.html

The Shah got a little too bold with nuclear and OPEC ambitions.

Since William E. Simon's 1974 petrodollar deal with Saudi Arabia, USA pivoted away from Iran to Saudi Arabia in its geopolitical alliance. USA was vying to push Shah out of power since then as he was increasing his regional role, pricing oil according to Iran's interests first, and etc.