It was hard to feel much animosity towards Theresa May as she stood by the podium with her husband Philip this afternoon, just before heading to Buckingham Palace and handing in her resignation.

It's not seemly to feel bitter when someone has failed and is on the way out. And for what it's worth, it does mean something to have a female prime minister with the man beside her, taking the supportive role we're so used to the wife adopting. "I hope that every young girl who has seen a woman prime minister now knows for sure that there are no limits to what they can achieve," she said.

She had every right to say it and it was important that she did. Unlike Margret Thatcher, you did not get the sense that she was ultimately quite suspicious of other women. She supported them.

But politics is politics. You have to provide a fair assessment of a premiership when it ends. And any fair assessment of hers will be damning.

May did have moments of success. She handled the Salisbury attack well. She was firm, fair and led the international response with exactly the right tone. Jeremy Corbyn wavered all over the place. It was a relief during that period that she was in charge and not him.

But the reality is that every aspect of her time in Downing Street was a failure. It was a failure politically, tactically and morally.

The political failure is there for all to see. She failed to deliver Brexit, which was her first stated goal. She also failed to do any of the other things she said she's do when she entered No.10 - understanding the inequalities that led to the Leave vote and addressing them.

It was also politically wrong in another sense. May's real defining political goal was immigration reduction. It was there with her gestapo-tinged Go Home vans. It was there with her fiercely reactionary 2015 Tory conference speech, which made up a load of old nonsense about human rights. And it was there in her response to Brexit, which focused laser-like on migration.

That red line created all the other problems. It meant soft Brexit - staying in the single market and customs union - was impossible, because it would involve free movement. And from that came the economic and trade costs of Brexit, and the agonising choices required by the Irish border issue.

Were it not for the immigration problem, these problems would not have arisen. Brexit would have been a political downgrading of Britain on the world stage, but not the tortured horror story it has become. The reason for our current predicament is partly due to her political priorities. They were wrong on their own terms, and they were even more wrong because of the consequences they entailed.

Her tactical failure, on the other hand, was quite elementary. She only had one tactic really: say anything to deal with today's problems, even if it meant creating further problems in future. This meant feeding all the ERG fantasy land nonsense, failing to address any of its contradictions, and thereby doing nothing to prepare the ground for the compromises which she eventually realised were necessary.

It also meant that she ended up lying an awful lot. She lied almost as easily as breathing. Even when quite aware of the compromises which would have to be made - for instance on divorce payments, transition, backstops, economic pain and more - she kept pretending that they did not exist.

That was an ineffective tactic. It failed to prepare the ground for what she'd need later. Eventually, it meant no-one could trust anything she said. But it also did something more serious. It spread the distrust of politicians which was one of the causes of Brexit in the first place.

But her final and most severe failure was moral.

She was actually quite Trumpian, even though her manner was so boring that it was occasionally hard to notice. She repeatedly tried to undermine and dismiss the institutions which keep executive power under control. She accused the opposition of undermining the will of the people. She failed to speak out when the judiciary was targeted by the press and did not instruct her justice secretary to do so either. She bullied the House of Lords for scrutinising what was going on with Brexit. She repeatedly tried to dismiss, sidestep and then batter down parliament. Eventually she was found in contempt of it. And not long after that she made a speech outside Downing Street trying frame herself as the defender of the people against MPs. She constant portrayed scrutiny or criticism of her actions as a betrayal of the people.

People tend to soft-focus this now, with generous assessments of May's commitment to what she perceived as the national interest. But her record is clear. In an age of populist authoritarianism of a type which poses a genuine existential threat to liberal democracy, she failed to hold the line. She saw the temptation and tried to join them.

Ultimately it was that - more than the failure on Brexit, the tactical inadequacy, or even the error of judgement on immigration - which was the real black mark on her record. It's not one she should be allowed to live down.

Ian Dunt is editor of Politics.co.uk and the author of Brexit: What The Hell Happens Now?

The opinions in Politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.