Because the two Gospels you and I cited say two different things. This is because they were written decades after Jesus was dead, by two different Greek speaking people who could read and write and who never met Jesus. And Greek is not thought to be the language of Jesus, nor for any Jews that were His contemporaries in Palestine. Jesus probably never met anyone who could read or write with the exception of perhaps Caiaphas and maybe Pilate, and they weren’t interested In His teachings. The skill was rare among Jesus’ population. This means that no one who could read or write probably ever heard the teachings of Jesus or saw His actions. The closest any of these Gospel writers came to Jesus was Luke, who was actually probably a disciple of Paul, and Luke could read and write. Paul of course could read and write as well, but never actually met Jesus during His lifetime or witnessed His deeds or His public ministries. This is important because Paul is Luke’s only link to Jesus. It naturally follows, and we can clearly see of course that the bible has conflicting accounts. Therefore, my point is that you can find something in the bible to support just about anything you want to say. People have been doing that for thousands of years. The passage I have cited about weapons is clearly in opposition to weapons and violence. The one you cited is clearly for weapons and violence. Because of the problems I mentioned above, Jesus turns out to be a rather shapeable character with respect to just about any point you want to make. That is the historical and factual truth on the matter. Because of this, 20 centuries later, He has become the Stretch Armstrong of philosophical, religious and political debate.
All the best
Gary