I’m sure they were unlucky.
But you can improve your odds of not being detained by a despotic regime, by not going in the first place.
And I’ve been to some silly places. Worst being Libya in the months after the death of Gadafi. But I had an armed escort at all times. In hindsight I probably shouldn’t have gone, but my company had kidnap and ransom insurance to cover employees working in silly places.
I definitely wouldn’t have gone as an independent traveler.
You can improve your chances of not being run over by a bus by never going out, but ultimately everyone does some form of risk assessment and works out whether the risk is worth the reward.
In your case, you presumably decided your armed guards were competent and trustworthy, and you were happy to be paid for the risk. I'm not sure everyone would be though.
The trouble with the way the average armchair pundit looks at this case is that they see no reward in going to Iran or in overland travel, so they can't understand why anyone would take the risk. Many would no doubt quite happily express this opinion on a mobile phone while driving.
My point on social media was that Iran has always been sensitive about photography. People routinely got in trouble for photographing the wrong thing, but the remedy was to simply expose the negatives or confiscate the film, and that could only happen if you were caught taking a photograph. In the world of social media, the photos can't be deleted and they can be viewed by the authorities, and both of those things dramatically increase the risk - I wouldn't take that risk for a few likes.