In Medieval Latin, dispendere was used in the ecclesiastical sense of "grant license 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 "to do away with" (1570s), "do without" (c.1600). Older sense is preserved in dispensary. Related: Dispensed; dispensing.

dispense with

Manage without, forgo, as in We can dispense with the extra help. Shakespeare had this idiom in Timon of Athens (3:2): “Men must learn now with pity to dispense.”
[ c. 1600
]

2.

Get rid of, do away with, as in The European Union is trying to dispense with tariff barriers.
[ Late 1500s
]

3.

Exempt one from a law, promise, or obligation, as in He asked the court to dispense with swearing on the Bible. This usage originally applied to religious obligations (to which the Pope granted dispensation).
[ Early 1500s
]