If you join the military with the intent to kill terrorists, is it a sin? I know killing in a war is not. But what about having the intent to bring safety of the world, or revenge against what the terrorists have done, or someone who just wants to feel what killing feels like.
Quite a range of reasons, but there people tend to have a variety of reasons for joining the military.
Governments have the God-given right to bring justice. "For rulers are not a cause of fear for good behavior, but for evil. Do you want to have no fear of authority? Do what is good and you will have praise from the same; for it is a minister of God to you for good. But if you do what is evil, be afraid; for it does not bear the sword for nothing; for it is a minister of God, an avenger who brings wrath on the one who practices evil" (Romans 13:3-4). We hope that because multiple people are involved in government that the actions taken are from an impartial view regarding what is right or wrong and not from an individual's desire for revenge.
A desire to make the world safer for others would be probably the more noble reason. Here is a respect for life as a whole. "For the commandments, "You shall not commit adultery," "You shall not murder," "You shall not steal," "You shall not bear false witness," "You shall not covet," and if there is any other commandment, are all summed up in this saying, namely, "You shall love your neighbor as yourself"" (Romans 13:9). While justice is called for, individual judgment is called upon to minimize the harm to others while justice is carried out.
Joining the military with the hopes of experiencing what it is like to take the life of another human being is probably the worse reason. Here life is treated as little more than a video game where the kill is just an emotional thrill. There is no respect for life. Nor would there be a drive to careful to do the least harm possible when trying to enforce justice.