ALMA observations of doubly deuterated water: inheritance of water from the prestellar environment