TUCHÓW, Poland—Last year, this small Polish town near the eastern edge of the European Union passed a resolution proclaiming itself a “municipality free of LGBT ideology.” In July, the EU responded by stripping funding for a program connecting Tuchów with a sister city in France.

For EU authorities, Tuchów had violated a fundamental right not to be discriminated against based on sexual orientation or gender, something protected in the bloc’s treaties and high-court case law. Some locals here, in a stronghold of Poland’s newly…