A hat and coat were hanging on the wall.

Literal

Wall [on-に] hat [and-と] coat [subject-が] hanging were.

かかっていた describes the past state of items hanging. The が marks the hat and coat as the subjects of the existential observation. 帽子とコート joins the two items with exhaustive と.