I don't think he's taking it to prevent the disease. He is taking it as a prophylactic to reduce the symptoms should he become infected. I did this for malaria when I went to India a number of years ago. I am guessing what they gave me was this medicine but its been awhile so I'm not sure. But I know I took it at the advice of my doctor in case I got malaria while I was there. Thankfully, I never did. But apparently his doctor has no concerns about it or if he does I am sure they are monitoring him for any adverse side effects. This medicine is prescribed 5 million times a year world wide.
Trump has been all over any treatment regimen that seems to have positive results and for good reason. He knows full well that the chances of having a vaccine by the next flu season is not all that great. SARS took 21 months which was a record. Fortunately it didn't come back in the fall. And there are many viruses that we've known about forever that we have never found an effective vaccine. AIDS is one example. So assuming it comes back in the fall like the Spanish Flu in 1918 and there is no vaccine we can avoid more economy crushing restrictions because of an effective treatment protocol. That is far more likely than finding a vaccine in the short run. Then we can focus restrictions on the elderly and those with co-morbidities that make them more susceptible to the virus and more likely to end up in the hospital or in ICU.
I think a better question is why the media is so fixated on a drug that is widely available, cheap to manufacture, has been used safely since 1955 for a variety of ailments and has been shown to be effective when combined with zinc, ZPAC, etc. other than they don't want to find a cheap and effective treatment so the crisis continues. To me that is what is odd. One would think they would cheer on such good news....but no, they fixate on lying about Trump telling people to drink Clorox.