Some dementia patients are being kept in their wards 24-hours a day for years on end, BBC Scotland has learned.
The report said many wards did not offer any activities
The discovery was made by the Mental Welfare Commission during unannounced visits to NHS hospitals in Scotland.
The organisation said the quality of care was patchy and poor care was often the result of not making simple, inexpensive changes.
About 58,000 Scots have dementia, with that figure set to increase dramatically as the population ages.
The Mental Welfare Commission said it found that some dementia patients had no access to the outdoors or a garden, and nine people had not left their ward since admission. In one case that was six years ago.
The commission said it found a very mixed standard of care when it made surprise visits to 16 NHS continuing care wards, with simple, inexpensive changes making a huge difference to the quality of life of dementia patients.
Experts have said that having contrasting colours on walls and furniture and signs on doors can help those with dementia be more independent, but only six wards did that.
Only half of the hospitals had found out more about the kind of person they were looking after, such as their likes and dislikes.
More than half the wards could not provide any evidence of having arranged social or recreational activities.
Last week, a report by Alzheimer's Scotland predicted that the number of people with dementia was going to rise by 75% as the population ages. About 40% of patients go into hospital or a care home.
Minister for Public Health Shona Robison said: "While I have not seen the detail of this report, the new Scottish government takes any suggestion that the care of our elderly people can be improved very seriously.
"We have made clear that the dignity and wellbeing of elderly people is of paramount importance and we will look at any recommendations in this report to see how services can be enhanced."