Er arbeitete in einem unterirdischen Raum mit nur zwei Ventilationsschächten, was seiner Gesundheit nicht bekam.
As far as I know, "was" means "what" or is the contracted form of "etwas"
But they wouldn't make sense here, so I guess the meaning should be something like:
He worked in a room underground..., and that was bad for his health