Multiple studies have found hydroxychloroquine to be effective when taken early:
Hydroxychloroquine and azithromycin as a treatment of COVID-19: results of an open-label non-randomized clinical trial
Efficacy of hydroxychloroquine in patients with COVID-19: results of a randomized clinical trial
Hydroxychloroquine and azithromycin plus zinc vs hydroxychloroquine and azithromycin alone: outcomes in hospitalized COVID-19 patients
The study that combined hydroxychloroquine with zinc was the most promising, which is why there are more studies in progress (for example). The reason this was looked into in the first place is because zinc inhibits conronavirus replication in vitro, but it needs to get into the cells to work. Chloroquine and its safer relative hydroxychloroquine can facilitate that. But as with any treatment that interferes with virus replication it has to be administered early, best if before symptoms even arise, hence you wouldn't have expected it to be effective in the study that only tracked those who were given it because there were already in desperately poor condition. Hydroxychloroquine is about a dollar a dose to produce, unlike Remdesiver which would be tremendously expensive to acquire if it works out, so I'd prefer the various media outlets stop spreading the type of misinformation you've no doubt read. Their desperation for clicks and the need for Trump to be wrong on this one aren't important enough to justify attempts to undermine public support for research into what may very well be a cost effective and relatively quite safe treatment.
Also:
In Vitro Antiviral Activity and Projection of Optimized Dosing Design of Hydroxychloroquine for the Treatment of Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-CoV-2)
He was almost certainly advised to do so, because that is how it's most likely to work. Unless he's lying or bragging about breaking the law, it had to have been prescribed to him.
EDIT: A more detailed explanation (text from the third linked study):
Several medications are under investigation for the treatment of COVID-19. Despite limited and conflicting data, the U.S. Food and Drug Administration authorized the emergency use of hydroxychloroquine for the treatment of COVID-19 with or without azithromycin. Chloroquine analogues are weak bases that concentrate within acidic endosomes and lysosomes. Once intracellular, chloroquine analogues become protonated and increase pH resulting in prevention of endosomal trafficking, dysfunctional cellular enzymes, and impaired protein synthesis[7]. This inhibits viral replication through interference with endosome-mediated viral entry or late transport of the enveloped virus. Further, this results in interference with the terminal glycosylation of ACE2 receptor expression which prevents SARS-CoV-2 receptor binding and spread of infection [8]. Hydroxychloroquine, a hydroxy-derivative of chloroquine, has also been proposed based on in vitro activity against SARS-CoV-2 with a three-fold higher cytotoxic potential compared to chloroquine [9]. However, clinical data in humans has yielded mixed results[10-12]. The anti-viral and anti-inflammatory effects of chloroquine have been suggested to account for its potential utility in preventing COVID-19-related pneumonia. Soon current studies will answer whether hydroxychloroquine is effective as monotherapy or in combination with azithromycin. In the case that hydroxychloroquine is found to be ineffective, it may still have a role to play when combined with zinc sulfate. Zinc inhibits RNA dependent RNA polymerase, and has been shown to do this in vitro against SARS-CoV[13]. However, it is difficult to generate substantial intracellular concentrations of zinc, therefore prophylactic administration of zinc alone may not play a role against SarCoV-2[14]. When combined with a zinc ionophore, such as chloroquine (hydroxychloroquine), cellular uptake is increased making it more likely to achieve suitably elevated intracellular concentrations[15]. This combination is already being tested as a prophylactic regimen in a randomized clinical trial.
As New York became the epicenter of the pandemic, hospitals in the area quickly adopted investigational therapies, including the use of hydroxychloroquine and azithromycin. Given this proposed synergistic effect of zinc with hydroxychloroquine, practices at NYULH changed and the addition of zinc sulfate 220 mg PO BID along with hydroxcychloroquine 400 mg once followed by 200 mg PO BID with azithromycin 500 mg once daily became part of the treatment approach for patients admitted to the hospital with COVID-19.