Yes, low vitamin D status is associated with all of the risk factors for COVID-19 mortality, e.g. liver disease, kidney disease, diabetes, old age, etc., etc. even without a person's having contracted COVID. (See "The Vitamin D Solution" by Michael Holick, M.D.)
And yes - it sounds like there might be ethical concerns regarding a prospective trial.
However, I have read that when testing is done for pharmaceutical drugs, if it becomes clear early on that the drug is safe and effective, then the trial is stopped, and all participants are allowed to take the drug. So, they may do the same in any testing of vitamin D w.r.t. COVID-19. Based on the following article (no need to view the accompanying video), Harvard researchers are planning to conduct such a trial, and are recommending vitamin D supplementation for those who would be low otherwise:
https://www.medscape.com/viewarticle/930152