What does To be or not to be have to do with religion?

'To be or not to be' is about suicide. The Christian religion, and maybe others, is against suicide on the basis that it is only God who should decide when a person dies.