Somewhat uncertain, but likely as a frequentative of dubō (attested only as a gloss by Paulus/Festus), denominative of *dubos (“in doubt”, adj.), from Proto-Indo-European *dwi- (“two-”) + *bʰuH- (“to be”). See dubius for details.
For the relation to "two" cf. Ancient Greek δισσός (dissós, “twofold; doubtful”), δοιάζω (doiázō, “to be in two minds”) and German Zweifel (“doubt”).