But one hospital trust in Leeds has made more than a quarter of a million pounds selling such treats to visitors, staff and patients through vending machines on its sites, an investigation can reveal.
Following a freedom of information request, the Yorkshire Evening Post found that the Leeds Teaching Hospitals NHS Trust, which runs St James' Hospital and Leeds General Infirmary, is currently home to 43 vending machines across five sites.
The trust made Â£60,000 from the machines last year, with each serving an array of soft drinks, chocolate, crisps or sweets. A total of Â£260,000 was made from the machines from 2013 to 2018.
The trust says it is working hard to promote healthier snacks, and insists it does not encourage unhealthy eating.
But a senior councillor in Leeds has reacted angrily to the findings, accusing the trust of sending out conflicting messages.
Coun Stewart Golton, a member of Leeds City Council's health and wellbeing board, said: "Hospital trusts are already under fire for their car parking charges, but this is an even more controversial money-raising move.
"The Leeds Teaching Hospital Trust is signed up to the obesity prevention work commissioned through the Leeds Health & Wellbeing Board, but the provision of high calorie snacks in vending machines throughout its buildings smacks of double standards.
"Patients, staff and visitors are a captive audience, and the hospital has a responsibility to make sure that people often already struggling with their weight are not left relying on a vending machine plying high sugar and salt foods to keep them going during long, stressful hours on a hospital corridor."
When providing the figures, the trust stressed that only a fifth of the soft drinks in its machines contain added sugar, and that each item of confectionery is limited to 250 calories per portion.
Coun Sandy Lay is a member of the Leeds health scrutiny board and also works as a nurse.
He said: "I think the NHS has to do more to be a role model here. Obesity and diabetes are causing early deaths.
"If the NHS says 'pop round to our vending machine and get yourself a Mars bar', this sends out mixed messages.
"There are healthy options in vending machines but there are also a lot of sweets, crisps and sugary drinks. The NHS should set an example here."
Coun Helen Hayden , chair of Leeds City Council's adults, health and active lifestyles scrutiny board, defended the trust, and argued the amount made from the machines needed to be put into perspective.
She said: “It has been good to see the recent research involving LTHT which found that simple changes made with vending machines can support people to make healthier choices without a negative effect on commercial viability.
"At a time when NHS budgets are under enormous pressure, it is understandable that hospitals seek ways raise income, and with over 1,000,000 outpatients and 100,000 inpatients last year, attending LTHT each year, as well as thousands of staff, it is important that we see the amount of snacks and spend per person in context.”
Simon Neville, Director of Strategy and Planning at Leeds Teaching HospitalsNHS Trust, said: “Vending machines enable us to provide patients, staff and visitors with readily available drinks and snacks across our hospitals, particularly on nights and weekends when some retail outlets are closed.
"We have taken part in an innovative pilot with Public Health England and our suppliers to make healthier snacks and drinks more prominent in our vending machines. The positive results of the pilot will now be used to provide recommendations to other hospitals and suppliers across the country.
"This demonstrates our commitment to giving our patients, staff and visitors healthy, affordable options and supporting them to make healthier choices. Visitors to our hospitals will now see healthier, low sugar options and smaller snacks in our vending machines and across our retail outlets.”
NHS England have also been contacted for a comment.