Obesity used to be regarded as a disease of affluent societies. In a sense, of course, this is true: you cannot be obese if you cannot afford enough calories. But we now understand that the story is more complex, and that children from low-income groups are more likely to be obese than those from the highest-income groups.

Our understanding of sleep deprivation has yet to see a similar evolution. Almost half the British population say they get six hours’ sleep a night or less, compared with around a twelfth in 1942. Experts blame developments such as electrification and the proliferation of entertainment; one neuroscientist went so far as to warn of a “catastrophic sleep-loss epidemic” recently. We need sleep for mental and physical recovery; for cognitive control, memory and learning. Sleep loss is associated with everything from obesity and Alzheimer’s disease to diabetes and poor mental health.

Sleep evangelists such as Arianna Huffington portray a world of busy professionals sending emails into the early hours, teenagers watching televisions in their bedrooms and parents shopping online when they should be winding down. The solutions are obvious, even if we struggle to find the discipline to implement them: turn off your phone and for goodness sake go to bed.

The truth is that poorer people sleep worse. You cannot buy sleep itself, but you must pay for the circumstances likely to induce it. Overcrowded, noisy, cold or unsafe housing makes sleep harder. So does shift work – especially if it is casualised and unpredictable. Poor nutrition and stress also take their toll. We fret about reaching for our smartphone at night, while those making the devices sleep on hard beds in shared dormitories with coworkers clattering to and fro, as Benjamin Reiss observes in his book Wild Nights.

“Social inequities are reproduced and even multiplied in sleep,” he writes; children in bad housing will struggle to concentrate in class after a poor night’s slumber. The gap is racial too. Lauren Hale, an expert on social patterns of sleep, notes that fewer black people get the recommended amount of sleep than any other ethnic group in the US, and less of it is the most restorative kind. Racism may itself affect sleep, perhaps because of the stress it causes; African Americans who report discrimination are more likely to say they sleep poorly than those who do not. Sleep is a social justice issue, requiring social solutions. Telling people to cut down on coffee is easy; improving labour laws is harder. But when people’s sleep problems reflect their lack of control over their lives, telling them they should change how they live is profoundly unhelpful.

Far worse is deliberately denying sleep – as international law recognises in listing extreme deprivation as a form of torture. Professor Reiss traces US racial sleep disparities back to slavery; Frederick Douglass said that slaves were more often whipped for oversleeping than any other reason. Such cruelties belong to another age. Yet only this year Bournemouth council installed bars on benches, so that people could sit but rough sleepers could not recline. Though it backtracked, such “hostile architecture” is increasingly common. “I’m allowed to lie down, but not to close my eyes,” a homeless man observed of security guards at one site. Few experiences are as delicious as good sleep to an exhausted body and soul. But those who most need to shut up sorrow’s eye and equip themselves for another tough day are the ones who find it hardest to do so.