cytokine storms lead to organ failure.
hydroxycholoroquine is a drug that reduces those cytokine storms. for that reason, it is given to lupus patients to try to prevent organ failure.
covid-19 can also cause cytokine storms, in it's final stages before death - of organ failure.
the hope has been that hydroxycholoroquine may therefore be useful in stopping cytokine storms in covid-19 patients in the same way that it does in lupus patients.
this is still experimental. and, it may be the case that other immunosuppressants may be better suited for the task.
again: i don't know why trump did what he did. it certainly wasn't the most rational way to secure a supply of the drug. and, as the drug is an immunosuppressant, it is a bad idea to take it as a prophylactic.
but, there is a valid use of this drug as a last resort, for people that are already on the brink of dying of organ failure, as a complication of the disease caused by the novel virus - and articles or media reports citing studies correlating use of the drug with organ failure as a reason to avoid it's use are misunderstanding what it's use is, and consequently losing the plot.