Tim Farron was right to resign as Liberal Democrat leader because of his "fundamentally illiberal and prejudiced views" on gay sex, former Lib Dem minister David Laws has said.
Mr Farron announced he was standing down as leader on Wednesday, saying he had been unable to reconcile his Christian faith with the demands of leading a "progressive, liberal" party.
His decision was hailed as "brave and honourable" by bisexual former deputy leader Sir Simon Hughes.
But Mr Laws, who is openly gay, accused the Lib Dem leader of fostering a "dangerous myth" about how people in same-sex relationships should be treated by society.
He said Mr Farron's views had harmed the Lib Dem election campaign, which saw the party gain just four seats rather than making the hoped-for breakthrough.
Writing for the i newspaper, the former chief secretary to the Treasury said: "You cannot be a leader of a liberal party while holding fundamentally illiberal and prejudiced views which fail to respect our party's great traditions of promoting equality for all our citizens.
"Many of us have despaired over the last few weeks in seeing all the good work of Liberal Democrats such as Lynne Featherstone, who drove through the equal marriage legislation under the coalition, undermined by Tim's failure to be able to give direct and liberal responses on his own attitudes to homosexuality.
"A Liberal Democrat election campaign which should have appealed to liberal voters of all ages has been undermined by the outdated opinions and views which Tim clearly holds."
Mr Farron faced intense criticism during the election campaign for failing to answer questions about his position on homosexuality.
While he made it clear he supported equal marriage and LGBT rights, he initially refused to say whether he thought gay sex was a sin, saying he did not only after days of pressure.
In a statement announcing his resignation, he said his faith had made him a "subject of suspicion" in a way which showed "we are kidding ourselves if we think we yet live in a tolerant, liberal society".
Mr Laws said the Lib Dem leader had "clearly implied that he views same-sex relationships as wrong, but will as a liberal vote to tolerate people who are in such relationships".
He added: "As a gay man, I do not wish to be `tolerated'. I wish to be respected for who I am.
"And I want a party leader whose respect for human equality comes before outdated and frankly offensive religious views."
Mr Laws said Mr Farron had "propagated the dangerous myth that our society can respect and embrace people in same-sex relationships while believing their activities and character to be in some way immoral".
He asked: "What sort of message of reassurance is that for the bullied gay child in a school in a part of the country that still struggles to recognise and respect homosexuality? 'You are doing wrong, but we will tolerate you' isn't nearly good enough."
Mr Laws, who described himself as "someone brought up in the Christian faith" said he was "immensely sad" Mr Farron had used his faith to defend his views on gay sex and said it was "astonishing and depressing" that some religious leaders continued to promote messages of "intolerance and prejudice" on the issue.
Mr Farron's surprise statement came just hours after home affairs spokesman Lord Paddick announced he was quitting in protest at the leader's views on gay sex.
He is due to carry on as party leader until Parliament breaks for the summer recess next month, when an election for a new leader will be held.
Former business minister Jo Swinson, who regained her East Dunbartonshire seat from the SNP in the General Election, has been installed as the bookies' favourite to succeed Mr Farron and become the party's first female leader.
Lib Dem health spokesman Norman Lamb and former business secretary Sir Vince Cable have indicated they are considering throwing their hats into the ring for the race to replace Mr Farron.
In a message on Twitter, Mr Lamb said: "Thanks to all those who have contacted me urging me to stand. I'm talking to (wife) Mary, family, friends and colleagues. Will then make decision."
And asked if he would stand, Sir Vince told The Independent: "I haven't ruled anything out. I'm consulting colleagues to get their views on what is the next best step for the party."