The story
Debt came into English from Old French dete and was written the way it was said: Middle English dette or dett. There was no B in the French word and no B in the English one.
The B is a Latin souvenir. The French word goes back to Latin debitum, "something owed" (from debere, "to owe" — the same root as debit). In the late Middle Ages and the Renaissance, English writers who knew their Latin began "correcting" spellings so that a word's Latin ancestor showed through. Dette became debt, with a B inserted to point at debitum.
Nobody changed how the word was said. The B was a letter for the eye, added to a word that had been pronounced "det" for generations, and it has stayed silent ever since. Debit, which was borrowed later and more directly from the Latin, does pronounce its B — so the two words are relatives that took different roads into English.
