There are two points here.
- If he was a UK spy then clearly he was found out and the matter could and should have been dealt with via back channels. I don't believe he was a spy hence the anger in the UK. There is no reason to accuse Jeremy Hunt of stupidity in the case.
- Snooping around any country doing security research without some prior approval is stupid, but does not deserve a life sentence nor a kangaroo trial.
Let's have some balance here. The UK knows the Russians in Salisbury were up to serious no good; I. E. Murder. Our academic idiot from Durham was naive, but not looking for ways to commit other serious crime.
I feel for him and would never voluntarily visit any Arab state for the reason that they have strange rules compared to western countries (rape victims are guilty of a crime) and they love to torture you having arrested you to get a confession.