The Shah wasn't Carter's puppet. The Shah came to power in 1941. In 1953, the U.S. backed the overthrow of Iranian Prime Minister Mohammed Mosaddeq. The Shah enjoyed U.S. support during the majority of his reign---support from Truman to Carter.
In fact, many on the right blame Carter for the fall of the Shah because Carter encouraged the Shah to loosen his autocratic rule and practice basic human rights. Carter eventually reluctanctly withdrew support for the Shah, which led to his outsting by a popular uprising that was, sadly, hijacked by religious fundamentalists.
When the Shah went into exile, his health rapidly deteriorated and he sought medical treatment in the U.S. Carter reluctanctly allowed him in, but asked him to leave soon after the treatment was complete. The decision to allow him into the U.S., though, angered the Mullahs in Iran and led to the hostage crisis there.
As an aside here, I highly recommend all to see the movie Persepolis. This is a brilliant tale of a young girl that experienced the excitement of the Iranian Revolution only to be overcome by the horrors of the rise of the Islamists.