Dexamethasone is an immunosuppresant which, almost counter-intuitively, works by switching OFF (to a large extent) the body's immune system.
With Covid-19 there obviously has to be a balancing act, as for those with only mild symptoms it would probably be best for a patient's immune system to be working well, whereas for those who're suffering the worst symptoms (which are largely brought about through a person's immune system responding far too vigorously to infection) it's important to suppress the body's natural immune response to a certain extent.
I suspect that the medical profession will have known all along that dexamethasone could be of benefit to Covid-19 patients but it's been getting the DOSAGE correct (as part of the 'balancing act' that I've referred to above) that's needed some research.