Esquire, as I understand it means "mister." But in modern usage it is an abbreviated American appendage to names that indicates one is a lawyer, and it is used for men and women. How did that happen?
According to Wikipedia's page for Esquire:
This practice presumably travelled across the pond where it was, over a period of time, abandoned by everyone except lawyers.
This topic is covered in an article in the American Bar Association's ABA Journal on the ethical ramifications of the use of the title by lawyers.
So, while lawyers were one among many professionals who were using the suffix back in Merry England, it's unknown why only lawyers continue to use it in the US.
Esquire (in BrE) means not sir- it's a default title for somebody who doesn't otherwise have a title.
I suppose some American lawyer wanted to sound important and didn't understand the irony.
SUPPLEMENTARY TO coleopterist's ANSWER:
Instructions of Sir Henry St. George, Clarenceux, to Thomas May, Chester Herald, and Gregory King, Rouge Dragon Pursuivant, and Henry Dethicke for the 1682-83 Visitation of Worcestershire.
SOURCE: The Heraldry of Worcestershire (1873), by H. Sydney Grazebrook, Esq.; Of the Inner Temple, Barrister-at-Law, Author of the “Heraldry of Smith,” &c., &c. I, xlviii-xlix.
Grazebrook adds that “Barristers are now always accounted esquires, their right thereto being sufficiently attested by the fact that the Court of Common Pleas refused to hear an affidavit, because a barrister named therein was not called esquire ; and now all the Courts invariably require counsel to be so styled.--See Burke’s Patrician, v., 114, and Bythewood’s Conveyancing ii., 386, where the question of “Who is an Esquire?” is discussed at length.”