Dr Mary Hepburn is not a convert to the reconfigured class system published by the London School of Economics this week, which suggested the UK now had seven different social classes.

The consultant obstetrician and gynaecologist who heads up Glasgow's Special Needs in Pregnancy Service (Snips) still talks in terms of traditional class divisions and preaches the work of a different set of academics: Richard Wilkinson and Kate Pickett, of the University of Nottingham and the University of York, the authors of the hugely influential book about inequality in Britain, The Spirit Level.

Dr Hepburn cites class differences to explain the exclusion of vulnerable women from mainstream antenatal care: "Services were all designed for middle-class women," she says, quoting The Spirit Level in defence of her claim that poverty, not drug use, is the defining health issue facing many of the women she works with.

The Snips service is for pregnant women whose situations are complicated by drug and alcohol use, HIV, mental health issues or other social problems. While Dr Hepburn's work has won considerable praise, the service also attracts more than its fair share of criticism. "We've had hate mail, people say that because we give mothers methadone we are 'killing the babies'," she says gruffly.

She has no time for the hate mail nor the criticism. "We want them on methadone. We don't get hate mail for giving insulin to diabetic women."

Ensuring women who use drugs are stable and in contact with services is simply common sense, she suggests.

Dr Hepburn was responsible for reconfiguring services in Glasgow in the 1980s to make them more accessible for those with challenging circumstances. "People would say these women don't come for antenatal care. But we were able to get these women motivated. We treat them with respect and it has made a huge difference."

Whereas middle-class women will miss appointments, they will generally get in touch and rearrange, whereas those with more chaotic lives may not, to the irritation of professionals, she explains.

Some women fear services will remove their children, so avoid even medical care, she says. "Our women are actually incredibly motivated. But we are very tough with them. We say we will be working with you and social work to get the best possible outcome but we can't guarantee you won't lose your children. We don't condemn behaviour like smoking, drinking, taking drugs, sleeping rough, but we don't condone them either. We treat people with respect and it has made a huge difference."

We are talking because a freedom of information request made by The Herald has uncovered statistics about the number of babies treated by Scottish health boards for neonatal abstinence syndrome – withdrawal from drugs used by the mother.

The results were wildly varied, with NHS Greater Glasgow and Clyde treating 31 babies in 2009/10, 18 in 2010/11 and 35 in 2011/12. NHS Lothian treated 70 babies over the same three-year period, and NHS Ayrshire and Arran confirmed it treated 12 in 2012, 13 in 2011 and eight in 2012.

Meanwhile other health boards treated fewer than five babies for withdrawal a year and several didn't treat any at all.

The findings are meaningless and impossible to interpret, according to Dr Hepburn. For one thing, many of the babies are withdrawing from methadone and better off for it.

"We want the mothers on methadone. Heroin is harmful to the baby and can cause death, prematurity and low birth weight. Methadone doesn't. It can and will cause withdrawal symptoms, but they are short term and we treat them," she explains.

This doesn't mean all is rosy. It is getting harder to fund services for vulnerable mothers and the need is greater than ever – thanks to poverty and inequality, Dr Hepburn suggests.

"We are lumbered with the highest rates of poverty-related ill health in western Europe. This is giving us worse outcomes. Poverty increases the rate of maternal mortality 20-fold. If a medical condition did that you would expect outrage,'" she says.

Outcomes for women eligible for the Snips service are worse than ever, she says. Dr Hepburn frequently works in eastern Europe and outcomes in Scotland are worse than they are there, and than in Vancouver, Canada, which has a similar pattern of drug use, she claims.

One factor is the age of the drug-using population. Drug users are getting older: 90% of women getting pregnant were aged from 17 to 24 years old in the mid-1980s, now the majority are aged from 25 to 35. "They are older, they have been using drugs for longer. They have been smoking and suffering malnutrition for longer.

"People attribute the bad outcomes to their drug use, but actually the main problem is their poverty. The drugs just make that worse."

The solutions she suggests are all about early intervention. Women who use the Snips service are much more likely to keep an unwanted pregnancy than middle-class mothers, she says.

But traditionally women would have been more likely to be offered contraception advice if going for a termination.

"We try to have long-acting contraception in place for vulnerable women by the time they are discharged from the hospital, but I think that's too late. We need it to be from the first visit.

"If a woman is saying she doesn't want to get pregnant, we should be saying let's make sure it can't happen by accident."

Other agencies in touch with vulnerable women should be doing this, but she suggests they don't raise the matter with women.

She is also critical of services such as the trials taking place in Glasgow of intensive work with parents after their infant children have been taken into care. "It should be done in advance. The tragedy at the moment is that we watch people fail."

Proper parenting support would include residential accommodation for women, offering 24-hour support so they can become the best mothers possible, Dr Hepburn adds.

The children's charity Aberlour operates a service like this, but more are needed. "We should not be concerned with 'can she parent'? but 'can this woman be taught to parent?'"

Some colleagues may believe she makes too many allowances for parents, she says. But it is a failure of the NHS if it cannot adapt to the needs of patients. "I care about the baby, but I get perceived as being on the woman's side. The paediatricians sometimes say that. But it is not about blaming people for their circumstances.

"Medical conditions such as maternal morbidity can be socially related. That is what is giving us the sick man of Europe tag, and unless we make services that work for everyone, that is what is going to bankrupt the NHS."