Masturbation almost certainly reduces a man’s risk of developing prostate cancer, yes.
If the holocaust helped Germany’s unemployment rate, how can it be immoral? Because an action’s having a single positive effect does not at all gurantee that it isn’t wrong.
If you’re framing your question in terms of natural law because it is biologically or “naturally” healthy, then consider this. Frequent ejaculation is that which actually keeps one’s prostate a little cleaner, which means that frequent child molestation also lowers one’s risk of developing prostate cancer. Does child molestation suddenly become moral for no other reason than that it has one positive “natural” effect? Of course not. Likewise, does masturbation suddenly become moral for no other reason than that it has one positive “natural” effect, despite all of the evil it entails? Of course not.
And even furthermore, masturbation is not even strictly biologically healthy, it is phsyically harmful in some ways as well. Jason Evert points out in his main book that every time you ejaculate, your body produces slightly less oxytocin, the key hormone for emotional bonding in sex. A man who masturbated every day for 20 years and then married would have destroyed his ability to chemically-emotionally bond with his wife during sex.
So, all in all, the “prostate cancer” argument carries no weight at all, and shows just how desperate some men are to justify their evil actions.
God bless.