Through hours of public debate and a razor-close council vote on Monday, Charlotte, N.C., a city that prides itself on being a beacon of progress in the South, grappled with how to live up to its values. Should it be a haven for free speech and diverse ideas, or take a stand against a strain of politics that many residents bitterly oppose?

At issue: whether to host the Republican National Convention in 2020.

To civic boosters and business leaders in a striving city, a political convention can look like a golden ticket, promising crammed restaurants, booked-out hotels and, perhaps most important, several days in the global spotlight.

But the leaders of North Carolina’s largest city found on Monday that they and their constituents were sharply divided on whether Charlotte ought to host this particular convention, which will presumably decide whether to nominate President Trump for re-election.

The reluctance had little to do with the complex logistical and security challenges surrounding a convention, or any doubts about whether Charlotte was capable of meeting them. It was mostly about whether a Democratic-leaning city with a carefully cultivated reputation wanted to associate itself with what Mr. Trump and many in his party now stand for.