It’s probably the weirdest puzzle in philosophy: do humans really have free will? (Spoiler alert: I won’t be resolving the matter here.) It certainly feels as if we do: at the supermarket, as I reach for some cheddar, it’s surely up to me to suddenly change plans and go for wensleydale instead. Yet this seems to violate the laws of science: everything that happens, including in our brains, is caused by earlier events, which are caused by earlier ones, and so on, all the way back to the start of time. There’s no room for spontaneous choice, cheese-related or otherwise. The problem has big implications: if we don’t have free will, for example, does that mean we shouldn’t punish murderers? So it was unnerving to learn about a study suggesting people’s beliefs on the subject change when they’re tired, sexually aroused or need to urinate. All three conditions, the psychologists Roy Baumeister and Michael Ent concluded, make us less likely to believe free will’s real.

In a way, that makes sense. To feel any desperate physical urge – for sleep, sex or a pee – is to be reminded that we’re slaves to our bodies, so naturally that might make us feel less free. (Kingsley Amis, paraphrasing Plato, reportedly described the male libido as “like being chained to an idiot”.) Besides, there’s plenty of other evidence for “embodied cognition”, the idea that our bodily states influence how we think. Apparently, you can boost your willpower by clenching your fist; you’ll give more “weighty” answers to questions when the clipboard they’re on feels heavier. Baumeister and Ent aren’t even the first to explore the psychological effects of needing the toilet: according to a controversial study, previously mentioned here, we make less impulsive decisions when feeling “increased urination urgency”. When exerting control over your bladder, the theory goes, you control other urges as well.

Yet there’s something uniquely unsettling about the notion that our most fundamental beliefs about existence, such as our stance on free will, might be so fragile as to be swayed in this fashion. Deep questions – our basic ethical principles, political convictions – are supposed to emerge from calm reflection. We flatter ourselves that we weighed the evidence, then select our position because it’s right. But Baumeister and Ent show that’s not the whole story. Our beliefs are built on shaky foundations. If you’re a British Christian, born and raised, isn’t it troubling to realise that, had you been born in Somalia, you’d think it was Islam, not Christianity, that was right? Some atheists love this argument, but it can be used against atheism, too. None of us, in the end, can be sure our views aren’t heavily influenced by random factors.

That might not matter if philosophical beliefs didn’t have real-world impacts. But they do: if you doubt free will, studies show, you’re more likely to cheat and less likely to help those in need. Where does it end? If you’re tired or lustful on election day, might you vote differently? Psychology panics me sometimes. Or maybe that thought, too, is just the result of drinking so much coffee today. I’ll be over here if you need me, frozen in existential confusion.

• Follow Oliver on Twitter

oliver.burkeman@theguardian.com