I don't know a particular word. That the end justifies the means is sometimes called the Jesuitical plea - a reference that is understandably held to be both offensive and inaccurate by Jesuits.