Tosefos to Bava Kamma 85a says this is exactly what the Torah comes to teach with the repetition of the words "רפא ירפא":
שנתנה רשות לרפאות - א"ת והא מרפא לחודיה שמעינן ליה וי"ל דה"א ה"מ מכה בידי אדם אבל חולי הבא בידי שמים כשמרפא נראה כסותר גזירת המלך קמ"ל דשרי
(Rough translation) - One may have thought that there is no right to seek healing from a sickness that comes from Heaven, as it seems like contravening the decree of the King [that this person should be sick]. This comes and teaches us otherwise. (See also Rashi there)
So the justification is that the Torah said it is OK.
The Ramban actually implies that a person does not have justification to heal himself through medical means (Ramban to Vayikra 26:11):
הוא מאמרם (ברכות ס) שאין דרכם של בני אדם ברפואות אלא שנהגו שאילו לא היה דרכם ברפואות יחלה האדם כפי אשר יהיה עליו עונש חטאו ויתרפא ברצון ה' אבל הם נהגו ברפואות והשם הניחם למקרי הטבעים וזו היא כונתם באמרם (שם) ורפא ירפא מכאן שנתנה רשות לרופא לרפאות לא אמרו שנתנה רשות לחולה להתרפאות אלא כיון שחלה החולה ובא להתרפאות כי נהג ברפואות והוא לא היה מעדת השם שחלקם בחיים אין לרופא לאסור עצמו מרפואתו לא מפני חשש שמא ימות בידו אחרי שהוא בקי במלאכה ההיא ולא בעבור שיאמר כי השם לבדו הוא רופא כל בשר שכבר נהגו ועל כן האנשים הנצים שהכו זה את זה באבן או באגרוף (שמות כא יח) יש על המכה תשלומי הרפואה כי התורה לא תסמוך דיניה על הנסים כאשר אמרה (דברים טו יא) כי לא יחדל אביון מקרב הארץ מדעתו שכן יהיה אבל ברצות השם דרכי איש אין לו עסק ברופאים
(My translation) - This is the meaning of Chazal (Berachos 60a) that the path of people is not through healing, except that they have become accustomed to such. If the practice had not become to seek out healing, a person would get sick according to his sins and would heal according to Hashem's will. But they accustomed themselves to treatments, and Hashem left them to the happenstance of nature. And this is the intent of their saying "And he shall heal him - from here we learn that permission was given to the doctor to heal" - they did not say that the patient was given permission to be healed, but since the patient got sick and came to be treated, since he accustomed himself to healing and is not from those whom Hashem is their portion in life, the doctor need not forbid himself from treating him ... and he need not say "Hashem alone is the Healer of all flesh," since they have already accustomed themselves to such. And therefore when fighting people hit each other, the one who strikes is held responsible for paying the medical costs because the Torah does not make its laws dependent on miracles. But as Hashem would want us to behave, there is no business with healing.