Most Helpful Girl
What it means is that the process by which a person takes to get the desired end result can't always be justified *by* the result itself.
So what the quote basically means, is:
The end result of a person's actions (while often times is good), can't always be justified by the actions themselves that that person took to achieve that result/goal in the first place. It's usually said about situations where in order to do something good, a person goes about achieving it in a "less than great"/bad way, which then begs the question of: is the end result worth more than the damage/wrongness the person is exacting in order to achieve the good result?
I'm trying to think of how to explain this in a more simple manner... Okay. So lets say that a person wants a murderer to be brought to justice. That's a good goal right? But, to catch this murderer the person ends up killing numerous people along the way after they interrogate them about the murderer's whereabouts. So in this case we have a person, who in the process of trying to do a good thing (find a murderer and bring him to justice), ends up killing several people themselves in order to find that murderer. In this case, the "end" (finding the murderer so that he can be put into prison, aka justice), is arguably not justified by the means (because in order to find the murderer, the person killed numerous people along the way).
Anyhow, hope that helped! :)