Singly and doubly deuterated formaldehyde in massive star-forming regions