Why do many cough medicines contain Capsicum Oleoresin which is actually Pepper Spray an irritant that makes you cough?

I don't think it's used to suppress your cough, but to increase mucous flow. Old-time remedies to relieve congestion sometimes call for cayenne pepper. So I think it's more of an expectorant, to loosen up airways and sinuses, than it is to prevent cough.