c. 1200, clergie "office or dignity of a clergyman," from two Old French words: 1. clergié "clerics, learned men," from Medieval Latin clericatus, from Late Latin clericus (see clerk (n.)); 2. clergie "learning, knowledge, erudition," from clerc, also from Late Latin clericus.
Meaning "persons ordained for religious work, persons consecrated to the duties of public ministration in the Christian church" is from c. 1300. Benefit of clergy (1510s) is the exemption of ecclesiastics from certain criminal processes before secular judges; in England it was first recognized 1274, modified over time, and abolished in 1827.
The ability to read, being originally merely the test of the 'clergy', or clerical position, of the accused, came at length to be in itself the ground of the privilege, so that the phrase became = 'benefit of scholarship' [OED]