Let's say that Iran has recently started pissing off most of the big, important countries, and Canada is no exception. Since there was already some bad blood between them, I guess they decided to take no chances, especially that Iran isn't exactly known to keep in line with international conventions, including Vienna Convention (which deals with protection of diplomats on foreign soil).
Not to mention Iran also pissed off US and Israel (and the rest of the world don't take kindly to it, either), which means we might see a war with Iran soon. Missiles will fly, maybe even nukes (I hope they won't though, but you don't really know with Israel), and Iran won't exactly be the best place to be for a couple of diplomats.