There is always wiggle room. Obviously every candidate is and will be Muslim - the question is how fanatical they are. For Iran's present religious establishment, Rouhani is not devoted enough and that alone is a serious commendation for the man in my book. Furthermore, his 57% vote share in a 4-way race is a convincing sign that most Iranians also think more wiggle room is in order. Wikipedia says "
he encourages personal freedom and free access to information, has improved women's rights by appointing female foreign ministry spokespeople, and has been described as a centrist and reformist".
I lived through the end of Communism in Hungary. I recall when going from one candidate in an election to two was a novelty. Even though both had to be party-approved, a few independents slipped through. Regimes are often not as monolithic as they would like to be.
Or perhaps not as monolithic as their opponents would paint them. Iran has been an enemy of the US for decades. Much like Russia. This does not mean all Persians and Russians are demons, terrorists, spies, saboteurs, gangsters or whatever is the scare
du jour. In fact, I believe most people just want to get on with their lives, whether in Iran, Russia, Britain or America. And if they can choose a leader who looks like he will tone the crazy down, the sane will do it.
Admittedly, I'm a bit uncertain about that last statment when relating to America, but you get the point.