Q: It is permissible to endanger soldiers in order to rescue a wounded soldier?
A: Certainly. This is part of the Halachot of the army. Without doing so, the military will not function. In civilian life, this is indeed a question: is it permissible for a person to endanger himself in order to save another person? It is a dispute between Achronim (later authorities). While the Torah does say "Do not stand idly by your fellow's blood" (Vayikra 19:16), the Radvaz writes that one only needs to save him without endangering yourself, as is known: "Your life takes precedence over your fellow's life." This is based on the Gemara in Baba Metzia (62a) which discusses the case of two people travelling in the desert, and only one of them has a jug of water. If both drink, both will die. If one drinks, he will make it to civilization. The Halachah is that one person should drink, i.e. a person need not save another person while endangering his own life. This is all-the-more-so true when one has the water. He is not obligated to give it to the other person. The Radvaz therefore said that it is certainly a mitzvah to save another person but one does not have to endanger himself since the ways of the Torah are pleasant (Shut Ha-Radvaz 3:625 and brought in Pitchei Teshuvah, Yoreh Deah 157:15). Other authorities disagree. They say that while it is true that your life takes precedence over the life of your fellow, it is obligatory for one to place oneself in uncertain danger in order to save the victim from certain danger. This is the opinion of Hagahot Maimoniyot (Hilchot Rotzeach 1:14 brought in Beit Yosef, Choshen Mishpat 426) and Kesef Mishnah (ibid.). Their source is the Gemara in the Jerusalem Talmud about a Torah scholar who was once taken captive. Many said: To our distress, prepare burial shrouds. Reish Lakish said: I am going to kill or be killed. Baruch Hashem, he was successful, but we see from here that Reish Lakish was ready to endanger himself to save another person. There is therefore a dispute.
In the article "Le-Mitzvah Ha-Aretz" (Le-Netivot Yisrael, p. 157), our Rabbi, Ha-Rav Tzvi Yehudah, agreed that a person should endanger himself to save another person. He brought a proof from the Gemara in Sanhedrin (73a) that one who sees a person drowning in a river, or being dragged by an animal, or being pursued by bandits, must save him, as it says: "Do not stand idly by your fellow's blood." In the majority of situations, a river, animal and bandit are dangerous. Furthermore, the Rambam (Hilchot Rotzeach 1:14) changed the word from "a person drowning in a river" to "a person drowning in a sea" which is an even more dangerous situation. And the Rambam wrote (ibid.): "One who can save and does not save transgresses: Do not stand idly by your fellow's blood." So a person who can save someone and does not transgresses?! The Rambam means that the only exemption for a person not to save another is when he is unable to save him.
For example, the Tzitz Eliezer holds that there is no permission to donate a kidney from a living individual, since it involves risk, both during and after the surgery. Ha-Rav Ovadiah Yosef in Shut Yechaveh Daa't (3:84), however, holds like the Radvaz that a person does not have to endanger himself to save another person, but donating a kidney is a minor danger, and one does need to take such a risk. Thus, even according to the Radvaz, one needs to take a low level risk.
But this whole discussion pertains to civilian life. In civilian life, a life threatening situation is by chance. In military life, however, risking one's life is an essential component. In the army, therefore, there is an entirely different modus operandi: All for one and one for all. While this saying is not found in the Gemara, but is the motto of the Three Musketeers, it is nonetheless true in Tzahal.
In the army, soldiers endanger themselves for the national good. The enemy is dangerous. We therefore go to war - in order protect ourselves - to kill the enemy with the risk of being killed. This risk is not by chance but part and parcel of army service. The soldier who fights with self-sacrifice knows that he is not alone and his brothers-in-arms will not abandon him. This knowledge gives him strength to fight. We therefore endanger other soldiers to save a wounded soldier. The basic philosophy of Tzahal has always been, and will always be, that we do not abandon a wounded soldier.
Perhaps you will say: What logic is there in endangering many soldiers to save one?! After all, the Torah says: "Be exceedingly careful to safeguard your life"! The Netziv in Emek Ha-Davar (Bereshit 9:5) and Ha-Rav Shaul Yisraeli in his book "Amud Ha-Yemini" explain that while in the army we must be as careful as possible, there is also another principle: We endanger ourselves as much as necessary.