Probably from public house(“(Britain) bar or tavern, often also selling food and sometimes lodging, pub”) or public(“open to all members of a community”) +-an(suffix forming agent nouns), apparently originally used humorously.[1]
Sense 3.2 (“person excommunicated from the church; person who does not follow a Christian religion”) refers to Matthew 18:17 of the Bible:[1] see the King James Version quotation under sense 1.
Matthevv vvhiche vvas other vvyſe alſo called Leui, beyng of a Puplican made an Apoſtle, firſt of all others compoſed and vvrote in Jevvrye, the ghoſpell of Chriſte in the Hebrue tounge, […]
1549 February 10 (Gregorian calendar; indicated as 1548), Erasmus, “The Paraphrase of Erasmus vpon the Ghospell of S. Luke. The .iii. Chapter.”, in Nicolas Udall [i.e., Nicholas Udall], transl., The First Tome or Volume of theParaphrase of Erasmus vpon the Newe Testamente, London:[…]Edwarde Whitchurche, →OCLC, folio xliii, verso:
[T]he Publicans, that is to ſaye, the cuſtomers and takers vp of tolles, […]
[T]here was a man named Zacheus, which was the cheefe among the Publicanes, and he was rich.
1760, Edmund Burke, “An Essay towards an Abridgment of the English History.[…]. Chapter III. The Reduction of Britain by the Romans.”, in [Walker King], editor, The Works of the Right Honourable Edmund Burke, new edition, volume X, London:[…][R. Gilbert] for C[harles] and J[ohn] Rivington,[…], published 1826, →OCLC, book I, page 232:
The provinces groaned at once under all the severity of publick imposition, and the rapaciousness of private usury. They were overrun by publicans, farmers of the taxes, agents, confiscators, usurers, bankers, those numerous and insatiable bodies, which always flourish in a burthened and complicated revenue.
Now, Mrs. Varden, […] believing, moreover, that the publicans coupled with sinners in Holy Writ were veritable licensed victuallers; was far from being favourably disposed towards her visitor.
He brings twelve men with him, fishermen, tillers of the soil, one a publican, all of the humbler class; and he and they make their journeys on foot, careless of wind, cold, rain, or sun.
Another ſort there be vvho vvhen they hear that all things ſhall be order'd, all things regulated and ſetl'd; nothing vvritt'n but vvhat paſſes through the cuſtom-houſe of certain Publicans that have the tunaging and the poundaging of all free ſpok'n truth, vvill ſtrait give themſelvs up into your hands, mak 'em, & cut 'em out vvhat religion ye pleaſe;[…]
1651, Jer[emy] Taylor, “Of Christian Sobriety”, in The Rule and Exercises of Holy Living.[…], 2nd edition, London:[…] Francis Ashe[…], →OCLC, section VI (Of Contentedness in All Estates and Accidents), page 140:
[…] I am fallen into the hands of Publicans and Sequeſtrators, and they have taken all from me, vvhat novv? let me look about me. They have left me the Sun and the Moon, Fire and vvater, a loving vvife, and many friends to pity me, and ſome to relieve me, […]
Nor could the Treasury effectually restrain the chimneyman from using his powers with harshness: for the tax was farmed; and the government was consequently forced to connive at outrages and exactions such as have, in every age, made the name of publican a proverb for all that is most hateful.