In addition to its antihistamine properties, diphenhydramine has anticholinergic properties (that is, it blocks the action of acetylcholine, which is used primarily by the parasympathetic nervous system).
According to the website I'm linking to below:
1) Diphenhydramine is relatively contraindicated in patients with asthma and COPD, especially during acute attacks, because anticholinergic actions may thicken secretions and reduce expectoration.
2) Diphenhydramine is classified as pregnancy category C. Antihistamines generally are not recommended for use in pregnancy, especially during the third trimester, because there is a risk of seizures in the fetus. Risks-benefits should be considered during pregnancy and in women expecting to become pregnant. Antihistamines are contraindicated for use in women who are breast-feeding because they can induce hyperexcitability in the infant, seizures in premature infants, and inhibited lactation. Alternative methods of feeding are recommended if diphenhydramine therapy is deemed necessary.
3) Diphenhydramine should be used with extreme caution in patients predisposed to or with closed-angle glaucoma. Due to its anticholinergic actions, it can increase intraocular pressure, precipitating an acute attack of glaucoma. Diphenhydramine must also be used cautiously in patients with open-angle glaucoma; glaucoma therapy may need to be adjusted.
By the way, on this last point, one way it leads to increased intraocular pressure is by causing the pupil to dilate, which blocks the normal flow of aqueous humor (the fluid inside the eyeball) out of the eyeball.