First of all, I am guessing that by “holy wars”, you meant the many wars between Catholics and Protestants after the Reformation.
More accurately, the Fifth Commandments is not against killing in general, but specifically against murder of another human being. Otherwise, it would be impracticable since every time we eat involves killing another life: animal or plant. Also, in the Old Testament, God frequently commanded the Israelites to kill their enemies; some for self defense, some for survival necessity, some for justice.
But as to holy wars, it is easy for us to see today that they were wrong, but not so clearly at the time. And don’t forget, there were not wars started by the popes. The Princes of Europe of the time were already aligning themselves with the Catholics and the Protestants. There were as much religious reasons as political reasons. Though some of the popes have given their blessings on the Catholic side, I doubt that they could start or stop any of the religious wars if the princes did not have their interests in them. And lastly, the Protestants and the Catholics involved were equally wrong. So, yes, the popes at the time were wrong to bless these bloodsheds, but so were everybody else on both sides.