The story in question is The Hammer of God.
Chesterton is referring to the very common conception of shoemakers as left-wing radicals. This image was common throughout the 18th and 19th centuries, and its basis in fact has been ably examined by Eric Hosbawm and Joan Wallach Scott. I summarised their researches in this area in discussing this earlier thread:
Short answer:
Great question! There's a long history of freethinking associated with shoemakers. Our sources don't mention atheism nearly so often as the politics, but Chesterton isn't inventing this; shoemakers had this reputation for centuries, and it seems to have been a reputation substantially grounded in behavior.
Discussion:
This is a great little byway of social history. Bear in mind that Chesterton was a high Anglican -- so high he wound up a Catholic. His views of novelty and and modernity were occasionally somewhat jaundiced, but there's some nuance. He had a view of social "fairness" which sometimes leads to him being labeled a socialist; that's a mischaracterization, but he wasn't monotonic. In your example he's conflating shoemakers' political reputation with an assumption of atheism-- this is less well documented than the politics of shoemakers.
First a distinction about terms: traditionally a "cordwainer" makes new shoes from new leather, while a "cobbler" repairs shoes, though this distinction disappeared, as did most uses of the word "cordwainer". So I'll call them "shoemakers" for generality, but just note that the precise meaning of "cobbler" can be slippery.
We can start by observing that washing the feet of the Disciples is a powerful performance later repeated as ritual act in Christianity, a sufficiently vivid example from Christ's life that its been repeated into the modern era as a trope of humility and service to one's fellow man. Contact with the feet of another takes on an aspect of "performance" that needs an anthropologist's analysis: we can find contemporary Popes performing this act. This is the kind of historic phenomenon that needs and I don't think has yet received the study of a cultural anthropologist, someone with training to discern just how behaviors, performance and mindsets are intertwined.
Shoemakers appear to have long had an association with politics-- as Shakespeare's Julius Caesar opens, we find a cobbler who's taking the day off to go see Caesar's triumph, and encourages others to do so as well. Thomas Dekker's "The Shoemaker's Holiday" [1599] doesn't enjoy anything like Shakespeare's success, but it notably discusses the rising prosperity of shoemakers, and in this case the rise of one particular character to be Lord Mayor of London.
So it happens that shoemakers _do_ have a freethinking reputation and reality. Recall from the French Revolution that skilled artisan workers were one of the the Jacobins' constituencies. These "radical artisans" show up again in 1848, and again during the Paris Commune of 1871, and shoemakers are prominent among these. A famous/notorious revolutionary shoemaker would be Antoine Simon, the sometime cordonnier turned revolutionary jailor of the young Louis-Charles (aka "Louis XVII", though never crowned) during the Revolution. The mistreatment of the Dauphin by the evil "Simon the Shoemaker" is the subject of a lurid literature in the 19th century, particularly in Catholic circles, and one illustration by Jean-Louis Prieur will give a sense of how this relationship was understood. https://imgur.com/a/xP6XWlO
Hobshawm and Scott [1980] have a wonderful essay on the subject, highly recommended. They remark that shoemakers could express their political opinions without fear of losing their jobs, and that the product of their labors was something whose quality their customers could judge-- a well made shoe is different to a poorly made one, and the customer knows it. They thus have a reputation of their own, a kind of pride in work that perhaps informs some of their social attitudes.
Now we move to the next question: "Why would shoemakers be radical?" Other trades, notably weavers, also had a reputation for radicalism-- but is there something about the trade that influences this way? Hobshawm and Scott have examples from all over the European world and European settled world -- England, France, the United States, Argentina.
Shoemakers seem to have enjoyed a long reputation as a sort of "folk philosopher" and curator of radical ideas -- and it's a bit of a struggle to come up with a reason. One suggestion is that these were skilled artisans who were in routine business contact with some of the last favored members of society-- tanners (a dirty and smelly process, tanning is sufficiently unpleasant that in place like India and Japan its done by the very lowest castes). The shoemaker also had the problems of a small businessman-- buying raw materials, collecting on debts, he was both an artisan and a businessman, dealing with the public. Shoemakers also seem to have made a fair amount of money, reliably.
We have a Victorian shoemaker's memoir of his life, "The autobiography of John Brown the cordwainer", published in 1858. He describes events that are today not much known, like the "London shoemakers' strike of 1812" and discusses how he came to join an early sort of union, though not called that -- the term he uses is a "trade or shops-meeting, which is a combination for support of wages". That he explains what it, suggests that the term might not have been immediately understood by general readers. We find notice in newspapers throughout the 19th century of "shoemaker's strikes", and one of the hints of radicalism is that the freethinking independent shoemakers ideals had found their ways into the newly industrial processes, an 1884 British newspaper article [Hackney and Kingsland Gazette - Wednesday 23 April 1884] describes
the most serious strike that has taken place in the shoe trade since shoemaking became 'a factory industry'
It further describes the tensions of employers who wanted to pay by piecework, and workers who wanted a more secure livelihood and protection against "the evil known as 'the sweating system".
I confess that I'm not really satisfied with any of the explanations of just how shoemakers come by their revolutionary and philosophical consciousness. We can say that there is both a reputation and a reality: it would be a great topic for a rising labor or social historian, particularly one with anthropology training; there's seems to be a lot here and not yet a comprehensive treatment.
Sources:
Hobsbawm, E. J., and Joan Wallach Scott. “Political Shoemakers.” Past & Present, no. 89, 1980, pp. 86–114.
Boulukos, Athanasios. "The Cobbler and the Tribunes in Julius Caesar." MLN, vol. 119 no. 5, 2004, p. 1083-1089. Project MUSE, doi:10.1353/mln.2005.0002.
Mansfield, Nicholas. “John Brown a Shoemaker in Place's London.” History Workshop, no. 8, 1979, pp. 128–136.
Montoya, Rosario. “Liberation Theology and the Socialist Utopia of a Nicaraguan Shoemaker.” Social History, vol. 20, no. 1, 1995, pp. 23–43.
Straznicky, Marta. “The End(s) of Discord in The Shoemaker's Holiday.” Studies in English Literature, 1500-1900, vol. 36, no. 2, 1996, pp. 357–372.