When we smoke or vape anything, including cannabis, we are putting smoke, a foreign material, into our lungs. The lungs are generally not designed to accept foreign material such as various types of smoke or vapor. The physical residue of smoke or vapor inhaled into the lungs is detected by the body as a "foreign material", and the lungs normally create a response: coughing, sneezing, and expelling of the foreign material detected, until the foreign material is completely expelled from our body.
This coughing, sneezing, and expelling of foreign material from the lungs, after smoking, are not symptoms of disease, in general, but rather symptoms of normal healthy bodily response to foreign material entering the human lungs. Note that all smoke should produce this reaction; if not, we are likely ill or becoming ill.
Note that inhaling tobacco smoke, over time, tends to suppress the above described response. But that is not a good thing. If our body does not expell foreign materials in our lungs, we could eventually die from that invasion.
Reducing the intake of such smoke or vapors might be a good idea if we want to reduce the resultant coughing, sneezing, etc.