I've thought about this kind of thing a lot over my own career.
I'm not a subscriber of effective altruism, but I'd generally agree with them that the single best thing an individual can do is maximally acquire resources and use them in strategical ways to try to make the changes you want to see in the world.
So if you believe you make 1.5x more in tech than in medicine, I'd consider whether just putting that extra money aside and spending it on causes you believe in would allow you to have more of an impact.
Imo going into medicine is a bad way to make a difference. It's a noble thing to do, but whether it's you the job or someone else is I very much doubt a single person or animal would care. If you want to make a difference you should be striving to do something that would actually leave the world in a better state for you doing it.
Nothing wrong with just doing what you want to do though... The easiest life to change for the better is generally your own.