I'm fairly certain that this has to do with pitch in Japanese and accentuation in English.
The natural pitch for デバグ【HLL】 is HLL, whereas デバッグ【LHLL】 would naturally be LHL (and バグ【HL】 is HL). To mimic accentuation by pitch (i.e. accented syllables get a high pitch after transliteration), the ッ is necessary to give the バ a (natural) high pitch. バグ already has the right pitch pattern and the best pronunciation approximation to "bug".
(Besides, バッグ is already a word, although here the ッ is probably used to imitate the /æ/ sound, like in キャッシュ "cash".)
So both バグ and デバッグ are to be the expected transliterations, and either pair バッグ/デバッグ and バグ/デバグ has shortcomings, albeit being more consistent in some sense.
Update 2022. Darius Jahandarie points out that nowadays katakana loanwords (especially computer/tech-related terms) are increasingly often pronounced with the heiban (平板) pitch accent (see Wikipedia on Japanese pitch accent for a brief description), so that the pitch accents for the two words in question would be バグ【LH】 and デバッグ【LHHH】.