c. 1200, "spiritual credit" (for good works, etc.); c. 1300, "spiritual reward," from Old French merite "wages, pay, reward; thanks; merit, moral worth, that which assures divine pity," and directly from Latin meritum "a merit, service, kindness, benefit, favor; worth, value, importance," neuter of meritus, past participle of merere, meriri "to earn, deserve, acquire, gain," from PIE root *(s)mer- (2) "to get a share of something."
Sense of "worthiness, excellence" is from early 14c.; from late 14c. as "condition or conduct that deserves either reward or punishment;" also "a reward, benefit." Related: Merits. Merit system attested from 1880. Merit-monger was in common use 16c.-17c. in a sense roughly of "do-gooder."