LONDON—Donald Trump on Wednesday lost a protracted legal battle over a wind farm in sight of his Scottish golf resort, as Britain’s highest court dismissed his appeal to halt construction.

The ruling comes amid growing disdain between the billionaire Republican presidential candidate and Scotland, where Mr. Trump in 2006 parlayed his ancestry into a $1.19 billion luxury hotel and links course near Aberdeen.

Mr....