Books were scattered around the room.

Literal

Room [in-には] books [subject-が] scattered was.

散らかる is the intransitive form meaning 'to be in disorder.' The ~ていた marks the past resulting state.