There are a few leading factors which have a bearing:
The first is well covered by other answers: that there was a didactic element to Book I of Das Wohltemperirte Clavier. By having this key, the most remote of the minor keys from the non-accidental A minor, represented by two different notations, it cemented the full circularity of the 12-tone system, both in terms of understanding the equivalence of both Eb minor and D# minor for the keyboard, but also how the idea of temperament worked to bring both to the same note.
Ledbetter's comment that the equivalence of Eb and D# minors was well-known among theorists and composers stands, although its use of Rameau's Traité de l'Harmonie does not seem to be correct (Rameau only gives Eb minor in his Supplément, at least in the original printing).
The second is because of strong historiographical evidence for the fugue of BWV 853 being originally in D minor. According to Ledbetter, the "most obvious pointer" is the scale in the soprano voice of bar 15 which in D minor would have gone up to the note c''', the top note of the keyboard that Bach was writing for, but now has to jump down to c#'' instead.
Ledbetter also gives the example of some stray accidentals from the "original" notation, B naturals instead of B sharps, E flat for E natural. However, the older convention of "sharp/natural" = go a semitone up, "flat" = go a semitone down still holds in many Bach manuscripts and printed editions from this time in the 18th century.
The factor of musical reference is more arcane but also very interesting. The prelude is in the style of a tombeau, making reference to the French Baroque school, with their highly dotted rhythms and tirata scale passages. Many recordings make use of notes inégales. The abundance of flats in the key signature is also part of this reference: one can think of Froberger's Tombeau in C minor or that of Louis Couperin, or how Bach himself uses the dissonance of the extreme flat keys in the Passions at the death of Christ.
On the other side, the fugue is one of the stile antico fugues and Ledbetter says "it is the only piece in Book I to have a substantial element of the modal tradition". Its subject is very clearly based in Dorian mode, and it has a very strict treatment of dissonance while being rhythmically very loose (so much so that the subject itself mutates quite a bit, again a stile antico feature). Hence it hearkens back to a D dorian modal palette, and by simply transposing up from D minor, it refreshes the "old" into something "new" while still making its roots clear.