The only free and comprehensive online etymological dictionary of the Spanish language
deber m. (Verb, Noun) "to owe;" "duty," (plural) "homework"
As a verb, first attested use is in the 12th cent.; as a noun, 16th cent. From Latin debere "to owe" but originally "to withhold." From de- (see de-) and habere "to have" (see haber).
Asturian deber, Portuguese dever, Galician deber, Catalan deure, French devoir, Italian dovere, Sardinian dèpere

"This literal interpretation corresponds to an actual use: [Latin] debeo is used in circumstances in which one has to give back something belonging to another and which one keeps without having literally “borrowed” it; debere is to detain something taken from the belongings or rights of others. Debere is used, for instance, for “to owe the troops their pay” in speaking of a chief, or the provisioning of a town with corn. The obligation to give results from the fact that one holds what belongs to another. That is why debeo in the early period is not the proper term for “debt.”" ~ E. Benveniste, Indo-European Language and Society (1973)