GALLIFA, Spain—The Spanish flag affixed to the town-hall facade of this Catalan hamlet isn’t something you’d expect to see on a public building. It is so small it looks like it ought to be attached to a toothpick protruding from a plate of flan.

A Catalan separatist politician hung the paper-back-sized banner as a way of complying with the letter of a national law requiring towns to fly the Spanish flag, while at the same time thumbing his nose at authorities in Madrid.

...