Germany started issuing machine-readable passports in 1988, and these passports already used the 'D' code (see an example here), which means the code was picked before the reunification with East Germany in 1990. According to Keesing Technologies (a document security company), Germany requested to use the 'D' code sometime in the 1980s:
The First Edition rigidly defined the dimensions and positions of the information fields in the VIZ, including the portrait. The MRZ was similarly defined. Otherwise, it is somewhat short on detail; for example, the three-letter country codes were to be found by referring to ISO 3166. This convenient approach ended when Germany asked for its code to be D, or rather D<<, and not the code specified in 3166. Special requirements for codes for stateless persons, refugees, and UN personnel arose as well, resulting in subsequent editions including a table of codes. Also, the location of check digits and their method of calculation were established; these are still in use.
My guess is that West Germany didn't want to use 'DEU' because at the time they still hadn't unified with East Germany, which used the ISO code 'DDR'. Since 'D' is the only common letter between the two codes and Germany already used 'D' for license plates, it probably made sense to use 'D' for passports as well, taking the possibility of future reunification into account.
Why would that matter though? In the event of reunification, all DDR passports would become obsolete anyway.
In 1988 wasn’t certain what form any German reunification would take - ultimately the East joined the West as five new states, but the West may have joined the East, or both states may have been abolished and replaced by a new state. Picking 'D' might have been a nod towards that possibility, as whatever the new state would be called, it was all but certain to have 'D' as its first ISO code letter.
Note that all of this is just speculation. You'd have to request archival records from Germany from the mid-80s to get the official justification, as ICAO's own documents don't talk about the reasoning.