Why would a montgomery gland around my nipple be sore and swollen?

Oil build-up? It's possible that a person could experience some pain from clogging of normal montgomery glands, and get relief from gentle washing and placing a warm moist towel over them for 20 minutes at night.
Could be blocked... Or possibly infected. Please see your doctor have it checked. Your doctor may recommend applying hot damp compresses to try to soften any obstructing material or make it come to a head like a pimple.