Why did radical followers of the Ayatollah Khomeini overrun the U.S. Embassy and take Americans hostage?

Radical followers of the Ayatollah Khomeini overran the U.S. Embassy and took Americans hostage to protest the admission of the Shah of Iran into the United States for medical treatment, or because the US was spying on Iran from inside the embassy.