The Labour leadership contest has, at times, made for a dire spectacle. Perhaps only the insurgent campaign of the veteran left-winger Jeremy Corbyn (who is interviewed by Jason Cowley this week) has provided any sense of vitality. Some of the blame for Labour’s plight – the party seems more demoralised and divided than at any time since the early 1980s – resides with Ed Miliband.

Mr Miliband presided over Labour’s worst result since Michael Foot’s defeat in 1983, and so his desire to resign immediately was understandable – but wrong. He ought to have followed the example of Michael Howard, who, after losing the 2005 election, stayed on in a caretaker role until the ­Tories selected his successor seven months later. It would have been uncomfortable for Mr Miliband to have faced the derision of David Cameron at Prime Minister’s Questions. But leadership, in the best interests of the party, is also about doing what you least want to do, no matter the consequences for your psychological well-being. By continuing as leader, Mr Howard prepared the way for Mr Cameron and George Osborne to win control of their party, just as he wished.

In the context of the decline in mass party membership and collapsing support for Labour, Mr Miliband’s desire to make the election of his successor a more open process was admirable. However, this contest has exposed the flaws of the new rules, under which anybody can vote for the next leader so long as he or she pays £3 to register as a “supporter”. The rules have made Labour vulnerable once again to entryism from the far left and to manipulation from the outside.

Should Mr Corbyn win the contest – polls put him ahead – Labour will have as a leader a career rebel who does not ­command the support of most of his parliamentary colleagues. Chaos and discord will inevitably follow, and yet Mr Corbyn will have the moral support of all those activists who have been inspired by his anti-austerity message. The parliamentary party will be at odds with the members: a toxic situation.

While it would be manifestly wrong to change the rules midway through a contest (although it is incumbent on Labour to carry out background checks of those registering as supporters to vote), urgent reform will be necessary, not least because Labour MPs have been so disempowered.

The Conservative model provides a possible template: MPs vote on their choice of leader and only their two most favoured candidates are presented to the members, who make the final decision. This process ensures that any leader will be acceptable to the MPs as well as having the broad support of the membership.

The flaws of the present Labour contest are critical, especially in the context of the challenges the party will face at the next election. On 28 July the Fabian Society published a report into the 2015 defeat. Its findings reaffirmed how perilous is Labour’s position. “The verdicts are of a defeat in the broad realm of ideas and positioning, not individual policies,” Andrew Adonis writes in the report’s summary.

Rowenna Davis, who failed to hold John Denham’s old seat of Southampton Itchen for Labour, observes: “The leadership seemed to assume that people were either needy, greedy or irrelevant.”

Sally Keeble, who did not regain Northampton North after losing the seat in 2010, highlights the urgent need for “a big picture that will appeal beyond our core vote”, and warns that Labour’s path back to power rests on reaching out to those “embedded in the Tory and Ukip ranks”. Her realism offers a welcome antidote to the gloom and introspection of so many Labour MPs.

The protracted and increasingly bizarre leadership contest, combined with the lack of direction and unease in the parliamentary party, despite the best efforts of the acting leader, Harriet Harman, has been a gift to a resurgent Conservative Party. The danger for Labour is that, as in 2010, the Tories ­exploit these summer months of drift and unrest to control the “narrative” of the parliament and define the ground on which the next election is fought – all of this before Mr Miliband’s successor has been elected.

It might already be too late.