The former Scottish National party politician Natalie McGarry has been sentenced to 18 months in prison for embezzling more than £25,000 from pro-independence campaign groups, some of which she appropriated while she was the MP for Glasgow East.

Women for Independence, one of the groups from which McGarry stole, expressed frustration at the lack of alternatives to prison available to the courts and vowed to continue campaigning on the issue.

Sentencing McGarry at Glasgow sheriff court on Thursday, the sheriff, Paul Crozier, said: “Your fraud and deceit was of the most serious kind.” He said the charges were especially serious “because of the nature of the organisations and position of trust you held”.

During a protracted legal process, McGarry changed counsel several times, refused to accept her own guilty plea and then finally pleaded guilty in April to taking money from Women for Independence (WfI) and the SNP’s Glasgow regional association between April 2013 and November 2015.

She embezzled the largest amount, £21,000, from WfI, a campaign group she helped set up and fulfilled the role of treasurer. The money was intended to go to a food bank in Perth and Kinross and a campaign group, Positive Prisons, Positive Futures.

She also admitted embezzling £4,661 in the course of her role as treasurer, secretary and convener of the regional SNP association.

Before the sentencing, Allan Macleod, representing McGarry, said she continued to maintain she was innocent of the charges. He detailed a catalogue of mental ill health starting before she entered parliament in 2015, including depression and anxiety as well as postpartum depression, which she experienced after the birth of her daughter in November 2017.

McGarry, 37, broke down in the dock as her lawyer told the court she had suffered a miscarriage this week while six weeks’ pregnant.

Macleod said: “Two weeks ago she considered that life could not get any worse and then it did. She was pregnant and miscarried. That happened on Sunday and that is something that for her has been absolutely devastating.

“She is at the lowest point in her life she has ever been. Her career is ruined, her reputation is in tatters, she has lost friends, colleagues, her reputation and job, and now her child.”

A spokesperson for Women for Independence, which was instrumental in a 2015 campaign to halt the building of a women’s super-prison in Scotland, expressed relief that the trial was over.

The group said it respected the sheriff’s decision but added: “We are frustrated, however, that there are not more alternatives to prison available for sheriffs to consider and we will continue to campaign on this issue.

“The general pattern of offending by women is such that we believe most women serving custodial sentences would be better served by community disposals which do not disrupt families, children or, in the long run, cost more but which can demonstrate real benefits to women to cut reoffending while making a valuable contribution to the community.”

Labour’s Margaret Curran, who was shadow Scottish secretary until losing her seat to McGarry in the 2015 general election, described the sentence as “harsh”. Curran tweeted: “Natalie and I had our differences but this seems such a harsh sentence for a mother of a young child. This must make the case for sentencing reform.”