I don't think good ends ever justify evil means; sometimes there is a necessary evil, but it doesn't make the means right. It is instead a moral sacrifice, doing evil for a greater good. But the judgement of the greater good has to be overwhelming, and it has to be a consensus, and it has to be judged by close reasoning rather than by mob opinion.
In the case of capital punishment, as was suggested above, the end is achieved just as well by imprisonment; killing Gacy makes us all guilty of killing, just as he was guilty of killing. Whether or not that serves the greater good, I cannot say (I am rather ambivalent about the concept, I don't think much of punishment as a deterrent for crime, and am not entirely certain that death is or isn't a proper consequence for killing), and it's the function of government to make those moral sacrifices for us. But the end (being rid of Gacy) does not justify the means of achieving it (killing Gacy); it's just more complicated than that.
In another question of ends justifying means, take the question of killing in self-defense. Does killing someone else in order to save your life justify killing? I don't think it does. It's certainly understandable, perhaps even excusable, but it is not just, it is not right in and of itself. Murder in self-defense argues that one person's life (mine) is more valuable than someone else's; the fact that the someone else has potentially thrown off the protection of law by attempting an unlawful act (murdering me, allegedly) makes self-defense a legal right, but it still doesn't make the act of killing right. It assumes that my life is more important than anyone else's, and that is morally wrong.
On a somewhat smaller scale, take the question of Eminent Domain. Now, most of the freeway systems that are indespensable to our economic and social progress were built over the foundations of a lot of people's homes, homes that were bought out (sometimes at a fair price but sometimes not) via eminent domain laws. The loss of people's homes cannot be right, but does the need for the freeway system outweigh the needs of those people to live in those particular homes?
It's a very complicated question, the needs of the many over the needs of the few, perceived needs versus real needs, and a host of other differing viewpoints; but I don't think the ends justify the means. I guess what I'm saying is that you can't justify anything: it's either right or wrong, or some bizarre mixture of right and wrong, but there's no real in-between.
After all, there's no such thing as true grey... it's only white particles and black particles standing closely together.