I think that companies and hospitals may be a separate legal entity but when discussing morality it is the people within them who are held accountable for the decisions they make - those decisions may be made collectively after a discussion of what is in the best interests of themselves, or individually e.g the board of directors or the H&S manager or the nurse or the doctor. If multiple people were involved in signing off on a system or process that turned out to be problematic then it might not be possible to identify and hold individuals accountable for their poor decisions. If organisations are taken to court it is based on legal accountability, not moral accountability. Individuals within the organisation are often also held legally accountable.
For example, when people claim the police is institutionally racist, they mean the people who made the decisions on how recruitment and training is conducted have put in place systems that mean white people will relate to and mainly hire white people who may have unconscious biases and lack of experience of other cultures, which affect the decisions that those white police officers make when policing. So they started recruiting more ethnic minority police officers who could relate to and understand the demeanour of ethnic minority members of the public and probably so that white police officers would have more opportunities to experience and become familiar with the cultural differences of their colleagues. If the individuals in the organisation do not change their outlook, the organisation cannot change.
I agree that the people making those decisions in organisations are mainly driven by self-interest as they know they will be held accountable for their decisions by other people - e.g. the public, the shareholders, the owners of the capital - and may lose their position in the organisation once judged.
So I think it is correct to say governments, courts and religions don't do things, but rather the individuals within them, driven by self-interest, who do things. Individuals interpret laws, policies, religious doctrines.
Hence the question being asked is how is some religious people some of the time persecuting people for their ideas any different from some politicians or Twitter users some of the time persecuting people for their ideas? It does not seem like religion is necessary for dogmatic approaches to flourish and stifle and persecute people for thoughts and ideas - because it seems it is part of human nature to be dogmatic in a variety of contexts and organisations and institutions and if people with a dogmatic tendency get into a position of power in an institution or on a platform that allows them influence over others, then there can be some seem unpleasant consequences until they are removed or leave.