Like someone mentioned already, it's a demonstration of power. But it goes well beyond that: it's about domination, discipline, constant monitoring, the reduction of individual agency, humiliation (you need permission for a basic human need) etc. The labour process theory says that that management systems are not only about coordinating work but about securing control over workers, that the drive for efficiency is also a drive for managerial control, including monopolising judgement and pacing work from above [0]
In many cases it's an intentional dehumanisation of the workers - they're seen as assets or numbers, as a type of machines that should be worked to their maximum physical and mental capacity and that are not owed any dignity [x], as if work is nothing more than mechanics. Foucault (in his "Discipline and Punish") speak about how disciplinary power produces "docile bodies" by making bodies more useful and easier to control, breaking functions and movements into optimised segments. [1] This is consistent with how the capitalist workplace normally operates, where employers want to control workers' time and actions, not just the finished product. We could see the toilet restriction just as an extreme, contemporary expression of the same thing. [2] For example, dodgy Amazon does that by making bathroom use hard and uses strict worker monitoring mainly as control/discipline thing, a sort of integrated control architecture (crazy pace + surveillance + comparison + dystopian ranking and whatnot) [3][6]
For all his faults, Heidegger's point (especially in his writing on technology) is relevant here, as he claims that modern systems tend to treat everything as a resource to be ordered, measured, and used. He says that things and people get turned into "standing-reserve" (basically stock to be managed) [4]
Many employers believe that loo breaks should happen in a workers' own time [5], which is both ridiculous and an shirking of responsibility towards society from businesses (which has always been the case).
What is certain is that this is certainly not as a serious productivity argument, despite what predatory companies like Amazon claim [z], because this kind of treatment can have (and often does, like the article shared above shows as well) severe consequences for health, dignity, and productivity. [7]
The fact that regulatory bodies like OSHA in the US, and especially in the EU, recognise the abuse pattern shows it's not just anecdote or rhetoric (like the Economist and similar papers often suggest), or that it applies to countries that aren't as developed as we like to think we are in the US and the UK, but a real issue that's rather common.
Also relevant: https://www.un.org/en/observances/toilet-day
[0] https://academic.oup.com/cpe/article/43/1/61/7684997
[1] https://plato.stanford.edu/entries/foucault/
[2] https://academic.oup.com/past/article-abstract/38/1/56/14546...?
[3] https://cued.uic.edu/wp-content/uploads/sites/219/2023/10/Pa...
[4] https://plato.stanford.edu/entries/heidegger/
[5] https://www.tuc.org.uk/research-analysis/reports/give-us-loo...
[6] https://tribunemag.co.uk/2023/09/they-treat-us-worse-than-an...
[7] https://sif.org.uk/why-workplace-toilet-access-matters/
[x] https://www.theguardian.com/money/2018/nov/19/thousands-uk-w...