The cause of a fire which spread to the roof of a hospital has been deemed to be accidental.