A doctor said he usually don't recommend cough medications why is that so? It's bad for health?

Not sure. Depends on the cause of cough, in young pts, itacute bronchitis is self limiting, persistent cough after a week needs work up and treatment.
Reason... A cough has an important function: to rid the lungs of potentially infectious material. So, a cough suppressant is not always a good idea since if the mucous remains in the airways, infection including acute bronchitis and pneumonia could occur. Most people are able to clear secretions with coughing making an expectorant unnecessary. Cough can be due to disorders requiring different meds entirely.