I also get this, but despite my strong suspicion that it's to do with MS (seems to have developed in parallel with other symptoms, and over the same timescale), I've never got an answer. I've had it confirmed it's not optic neuritis - which I never thought it was - but I've never had any diagnosis of what it actually IS.
In my case, it's always the same eye. Infection has been ruled out. The only suggestion so far has been that it's something resembling an allergy. I'm rather prone to allergies, as are other members of the family. So I might accept this - IF it wasn't just the one eye. Surely, you're either allergic to something or you're not? Allergy in only one eye makes no sense to me. I've had my makeup blamed, and all sorts, even though I've never noticed any correlation with cosmetic use. I've had it happen when I've not worn makeup for ages; equally, I've had spells when I've worn makeup daily, with no problem whatsoever. So there's no rhyme nor reason to it.
I've found a prescription of steroid drops has been the only thing that really helps, but these are not safe for long-term use, so I have to wait until I'm desperate before asking. The doctor sometimes forgets, and tries to fob me off with antibiotic drops instead - which are the usual recourse, with such symptoms. So I have to remind her this is a recurring problem, not a new thing, and that we already established antibiotics don't work!
"Oh, don't they? Are you sure?"
"Absolutely positive. Steroids work, though."
If I'm trying to soldier on without steroid drops, I sometimes take a combination of antihistamines (on the assumption it IS similar to an allergy), aspirin (to try to reduce inflammation as far as possible), and moisturising eye drops. These are certainly not a fix, but dogged perseverance seems to calm it down slightly. To try to stop it crusting up at night, I sometimes apply a dab of vaseline or baby oil on the lid before going to bed. Again, this doesn't make a huge amount of difference, but just seems to keep it moisturised enough that it's not painfully glued shut in the morning.
Certain auto-immune diseases definitely CAN cause eye irritation, but MS is not generally considered to be one of them. So far, I've consistently tested negative for all the others, so MS is the only chronic condition we know I've got.