You should count each target word per month rather than returning the count of file IDs. Like this,
cfd = ConditionalFreqDist(
(month, word)
for month, word_counts in monthly_word_counts.items()
for word, count in word_counts.items()
for _ in range(count)
)