mid-14c., dispensen, "to dispose of, deal or divide out," from Old French dispenser "give out" (13c.), from Latin dispensare "disburse, administer, distribute (by weight)," frequentative of dispendere "pay out," from dis- "out" (see dis-) + pendere "to hang, cause to hang; weigh; pay" (from PIE root *(s)pen- "to draw, stretch, spin").
In Medieval Latin, dispendere was used in the ecclesiastical sense of "grant licence to do what is forbidden or omit what is required" (a power of popes, bishops, etc.), and thus acquired a sense of "grant remission from punishment or exemption from law," hence the use of the English verb in the senses "to do away with" (1570s), "do without" (c. 1600). The older sense is preserved in dispensary. Related: Dispensed; dispensing.