Do the ends justify the means? To understand this question we have to deconstruct it. There are, I think, three ways to look at this question. First, we can say that we can ethically judge only the means: good ends, whatever they might be, are just the ends that results from good means; on this view, the ends cannot justify the means. Second, we can say that we can ethically judge only ends; good means, whatever they might be, are just those that result in good ends. The third is to say that we can judge both the means and the ends, and sometimes we have to weigh the good of the ends against the bad of the means (and vice-versa): sometimes we might have to employ bad means to obtain a good end (e.g. lying to the Nazis to hide the Jews); sometimes we have to accept bad ends to employ good means (e.g. risking a Romney victory by not voting for Obama because he's insufficiently progressive). The first is usually labeled deontic ethics, the second pragmatic ethics, and the third is a mixture, juxtaposition, or dialectical combination of deontic and pragmatic ethics.
All three constructions are problematic.
Deontic ethics have an essentially epistemic problem: how do we know whether some means are intrinsically good or bad, independently of the ends? We have our intuitions about means, but how do we know our intuitions are accurate? Remember, for everyone who asserts that lying or killing is intrinsically wrong, independently of the outcome, there's another who asserts that atheism, or homosexuality, or equal rights for women or black people, etc. is intrinsically wrong, regardless of the outcome that would result from tolerating the intrinsic wrong. But how do they know? By definition, we cannot evaluate the intrinsic ethical character of some means by looking at their ends, so what can we observe to determine the character of means, especially when there's controversy about people's intuitive opinions of means?
Pragmatic ethics suffer from the "Omelas" problem, from Ursula LeGuin's story. What if we really could achieve very great positive ends (the deep "spiritual" fulfillment of a whole society) by small but horrific means (the unremitting torture and degradation of a single child)? It intuitively seems that there are some acts that shock our consciences so deeply that even though the harm is relatively small, no possible gain could justify it, especially when the harm is intentionally inflicted, rather than accidentally occurring. That there are some means that seem so desperately wrong that no ends could possibly justify them deeply challenges pragmatism.
A mixed strategy just brings in both problems without resolving either.
Fundamentally, I've come down on the pragmatic view. We can, in theory, judge only ends, not means; it therefore trivially follows that the ends justify the means. We can see people's happiness and suffering more directly than we can see the ethical value of means, and our judgment of happiness and suffering (broadly defined) as good and bad, respectively, seem relatively uncontroversial. Once we accept that human (or sapient, or sentient) happiness and suffering are morally relevant, our epistemic problem disappears.
But the pragmatist must explain our intuition that means really do have intrinsic moral character. Even (and perhaps especially) if these intuitions were completely erroneous, why would we have them? Why do they seem so compelling? Why do some walk away from Omelas? Why do we have very different intuitive reactions to the different constructions of the Trolley Problem, even though the outcomes seem exactly identical?
Although pragmatism solves the foundational epistemic problem posed by deontic ethics, it has its own practical epistemic problem. We cannot know all the ends that will from any means even in the short term, and we know no ends at all in the long term. Theoretically, a pragmatic philosophy must look at every implication of every actions, however trivial, until the end of time, to make an optimal choice. This kind of infinite analysis seems entirely impossible.
A curious paradox! We can know what the means are exactly, but we have no basis to judge them. We can judge the outcomes consistently, but we cannot know completely and exactly what they actually will be. We cannot judge what we can know, and we cannot know exactly what we can judge.
However, while the epistemic problem of deonticism seems fundamentally unsolvable, the epistemic problem of pragmatism is at least partially tractable. We cannot analyze outcomes completely, but we can often analyze outcomes well enough to make justifiable decisions. We can, for example, analytically predict with measurable confidence that laws against murder really will result in greater overall happiness, with the benefits clearly outweighing the drawbacks, even though we don't completely know the outcome in precise detail. If chance* really does exist, then chance seems to be proportional to distance and time: it is impossible to predict the effect that my eating eggs in the US for breakfast this morning will have on a middle-class family in China because all the chance between me and them renders the effects of my actions unpredictable.
*In the sense of in-principle unpredictability, which is compatible with ontological determinism.
In addition to our reasonable analytic capacity, we also develop our pragmatic understanding from cultural evolution. We know from history, for example, that people seem happier and suffer less in societies that have a particular range of liberty, somewhere between absolute submission to authority and chaotic, uncoordinated individualism. This finding is not directly analytical, but seems scientifically supported by a study of history. Thus, there is evidence that our moral intuitions about means is just our accumulated understanding of what has and has not pragmatically worked in the past; it's not some mystical judgment about the means themselves, independent of any possible ends.
Indeed, I've argued before, the main problem with Omelas (and related arguments) are their lack of realism. It's difficult to believe that the torture of a child really could result in the spiritual fulfillment of a whole society. We might be reacting negatively to the torture of a child simply because, on some intuitive level, we do not believe that such torture really could have good results; we might really object that the result of the torture could not possibly be as LeGuin describes it. Other counter-arguments, such as the Trolley Problem, can be similarly recast in pragmatic/habit forms.
We cannot differentiate between deontic and pragmatic meta-ethics directly by experiment. Every pragmatic conclusion can be recast as a deontic conclusion, simply by saying that it's irrelevant that deontically good means tend to have pragmatically good ends, simply because we've become conditioned to approve of the ends that come from good means, just as in a pragmatic philosophy, we say that we become conditioned to deontically approve of the means that generate good pragmatic ends. We can, however, differentiate between deontic and pragmatic meta-ethics metaphysically: pragmatism is simpler and more direct than deonticism, with fewer ontological entities. Hence, pragmatism is a better meta-ethical system than deonticism.