A defence minister has pledged to help recognise the service of thousands of women dismissed from the armed forces because of pregnancy.