The expression alludes to a group that others will look up to. John Winthrop utilized this expression to portray the Massachusetts Bay colony, which he thought would turn into a sparkling case of Puritan perfection. In spite of the fact that it has a religious implication, this expression could be utilized to portray any group/nation (even the U.S.) that ought to be followed.
"A City upon a Hill" is an expression from the story of Salt and Light in Jesus' Sermon on the Mount. In Matthew 5:14, he tells his audience, "You are the light of the world. A city that is set on a hill can't be hidden." It has turned out to be prominent with American politics.