SAN CUGAT DEL VALLES, Spain—Every night at 10 p.m., José Domingo’s building becomes a microcosm of the divide that has riven Catalonia, pitting those who want independence for the region against those who believe it should remain united with Spain.

Each evening, around a dozen neighbors step onto their balconies in this well-heeled town outside Barcelona and bang pots and pans to show their support for the independence of the wealthy region in northeastern Spain.

...