Some forms of utilitarianism (consequentialism) are more subtle than others. In Act Utilitarianism, the morality of each act is to be judged by balancing the utility (good) produced against the disutility (evil). If the good outweighs the evil, then the act is good; if evil outweighs good, then the act is evil. There are many well-known problems with this way of looking at things, not least, how to compare different outcomes, what standards of utility one employs (some crude Utilitarians use pleasure, but even that is not unproblematic), and how far one is to consider consequences which could, in theory, be infinite in extent and in time. Rule Utilitarianism attempts to circumvent some of these problems by focusing, not on individuals acts and their outcomes, but on types of acts and the types of outcome that, as a rule, those acts have. This goes some way towards solving some of the more egregious problems but not all the way.
Generally speaking, for utilitarians, intentions count for nothing, The outcome is all. For deontologists, on the other hand, it can sometimes appear that intent is everything and consequences count for nothing. While deontology captures some of our ethical intuitions, leaving consequences out in the cold has its own counter-intuitive appearance.
So, do the ends justify the means for consequentialists/utilitarians? In a word, yes.
All the best,