We say the ends justify the means... but if we poison the means, do we not also poison the ends?
"The ends justify the means"
Is an excuse doctrine, enabling pragmatism to be used as an excuse for any and all atrocities.
The true problem occurs when the end is genuinely useful and even desirable, such as when a medical breakthrough comes from something like the holocaust.
Is the end tainted by the means or can we look upon the end as atoning for the means by which it has been discovered?
This I believe is the essence of your question.
I feel that such discoveries may well have been found by other means at another time and that knowledge is knowledge regardless of the source, facts are neither good nor evil, the end may not justify the means but in such cases to deny those in need compounds the atrocity.
One can admire and mitigate an end while condemning the means by which it was incidentally discovered.