Bismillahir Rahmanir Rahim.
This is a major intellectual faux pas and many educated people and the uneducated alike, suffer from this confusion. An evil act remains evil in all its forms; no matter how we interpret injustice, this principle remains the same. No forbidden action can ever become virtuous or lawful, due to goodness of intention. The perpetration of terror, violence and bloodshed cannot be considered or become a pardonable action due to any good intention or pious conviction. It is through precisely these false claims that terrorists attempt to justify their unlawful actions and too, recruit others to their way of thinking. This is a dangerous and warped mind set with no foundation in the teaching of Islam. On the contrary, Muslims believe that good intentions can never change a vice into a virtue.
And Allah(swt) alone knows best.