The pronunciation where /t/ is pronounced like a d sound follows a general pattern where /t/ between vowels (or after /r/ and before a vowel) is frequently changed into a voiced consonant that sounds like /d/, as in words that you mention like bitter and sitting. (Phonetically, the consonant is usually an alveolar flap or tap, written [ɾ] in the international phonetic alphabet, but American English speakers hear this as a /d/ sound.)
In terms of explaining what's going on, here's my hypothesis. It seems likely that the orginal reason for /t/ not being voiced to a d-like sound in words ending in a vowel + /t/ + -en is because of the use of the pronunciation with syllabic [n̩]. For speakers who use this pronunciation, there is no vowel sound after the /t/, which would explain why voicing, which usually applies between vowels, doesn't occur. Instead of being voiced, /t/ is very often glottalized in this context, producing a pronunciation containing a glottal stop (the sound in the middle of uh-oh, written [ʔ] in the international phonetic alphabet)—that is, [ʔn̩]. This fits with the possible occurrence of glottalization for syllable-final /t/ beforein other contexts where it falls directly before a consonant sounds, such as in witness.
Keep pronouncing /t/ as a voiceless sound, even between vowels. There is no longer a clear phonetic motivation to do this if the speaker uses [ən] instead of [n̩]. Some speakers do use [ʔən], but apparently some people find that this sounds odd to them (I think impressionistic descriptions of /t/ being "lost" in words of this type actually refer to pronunciations ending in [ʔən]).
Pronounce /t/ as a voiced sound in accordance with the usual pattern.