you have to free the ghosts soul. also if i remember correctly not all of the doors/secret doors in the prison open because they are so old or something. i think there is only one door that doesn't open at all though and you can still get through the prison. just explore the prison a bit.