Iran is basicly Europe with better food and is as much a theocracy as the UK (Ahmadinejad years aside). The Persians are too rich and educated to fall into the militant radicalism that causes most terrorism (the so-called Islamic Revolution was a liberal uprising that got hijacked at the end, not a theocratic takeover) and up until they started killing IS scum hadn't poked the Mideast hornet's nest to provoke outside attacks like today's.
Since the 1979 Islamic revolution, Iran has backed an array of terrorist groups. These groups have fostered unrest in Iraq and the oil-rich Gulf Kingdoms, killed Iran’s enemies in Europe, and struck at enemies like Israel and the United States. Most infamously for Americans, Iran has backed the Lebanese Hizballah, providing it with hundreds of millions of dollars, sophisticated arms, and advanced training. Among its many operations, Hizballah in 1983 bombed the U.S. embassy and the Marine barracks hosting U.S. peacekeepers in Beirut, killing 17 embassy officials and 241 Marines. Iran has also backed Hizballah in its numerous operations against Israel, including a 2012 bus bombing in Bulgaria that killed five Israeli tourists and the bus driver, and has given money and weapons to Hamas, which has used these to attack Israel in repeated clashes. Tehran has also quietly maintained links to Al Qaeda itself, hosting several important figures though also restricting their activities.
For Iran, ties to terrorists served multiple purposes. Ideologically, Tehran often believed that the terrorists’ goals – to spread an Iranian-style Islamic state, to overthrow an apostate regime, to battle Israel, and so on – were the right ones, and thus it was supporting the “good guys.” But strategic considerations also proved vital. Ties to terrorist groups enabled Iran to extend its influence around the world, something its weak military and struggle economy could not accomplish. With ties to groups like Hamas, Iran was also able to establish itself as an important actor against Israel – always a popular cause in the Middle East – and, in so doing, live up to its self-image of being an Islamic revolutionary power, not a champion of the Shi’a community, which is a minority in most Arab countries.
https://www.brookings.edu/blog/markaz/2013/11/21/irans-terrorism-problem/