Deuteration of formaldehyde - an important precursor of hydrogenated complex organic molecules - during star formation in our Galaxy