(Edited thoroughly after OP provided the context)
潔癖症【けっぺきしょう】の患者 is a person who pathologically loves cleanness and compulsively keep washing everything. Without the context, I had difficulty parsing this sentence with confidence. Specifically, I didn't know whether "潔癖症を患ったように" modifies "純白の部屋" or "視線をやっていた".
- 潔癖症を患ったように純白のこの部屋 ((?)pure white room which looked as if it had 潔癖症)
- 潔癖症を患ったように写真に視線をやっていた (looked at the photo as if he had 潔癖症)
(The second one makes sense, because "repeated checking" is one of the symptoms of this psychiatric disorder)
But with the context OP provided, there is only one way to interpret this sentence. While "whiteness" of the room was emphasized in this chapter (蚕の繭の中にいるようだった), the boy remains basically calm and collected (少年は…大人びた表情で何かを静かに考えていた). So obvisouly, the first one is the author's intention.
That said, I'm afraid this 「まるで潔癖症を患ったように純白の部屋」 is awkward, because a room never gets sick! It is the owner of the room who may get sick. You have to add extra characters to make this phrase valid: 「まるで潔癖症を患った人のものであるかのように純白の部屋」, or "pure white room which looks as if it belongs to a person with 潔癖症." After fixing this error, the whole sentence looks OK (although very complicated):