“The Children of Israel were in the wilderness and they found a man gathering wood on the Shabbos day. Those who found him gathering wood brought him to Moshe and Aaron, and to the entire assembly. They placed him in custody, for what should be done to him had not been clarified. Hashem said to Moshe: The man shall be put to death; the entire assembly shall pelt him with stones outside of the camp.” (Bamidbar 15:32-35)
These Pesukim describe the sin and fate of the ‘Mekosheish’ – the man who gathered wood on Shabbos in the public eye. The Gemara (96b) reveals that this man was none other than Tzelafchad whose daughters famously claimed an inheritance in Eretz Yisrael.
Why was there any doubt as to the punishment for the Mekosheish? The Gemara (Bava Basra 119a) explains that while Moshe Rabbenu certainly knew that somebody who violated Shabbos was liable to the death penalty, he had not been told which form of capital punishment it should be. Therefore, he placed the Mekosheish in custody until Hashem revealed the punishment. The Maharsh”a (Chidushei Agados, Bava Basra 119a) contends that this was, in fact, what motivated Tzelafchad to act as he did. Since the specific punishment for violating Shabbos had yet to be revealed, he decided to perform a Melacha on Shabbos so that he would be put to death and everybody would become aware of the punishment!
How could Tzelafchad justify sinning so gravely just to teach people the punishment for violating Shabbos? The Maharsh”a explains that Tzelafchad’s act may only have been a “Melacha She’eina Tzricha le’Gufa” – a Melacha that is not performed for the same purpose as it was during the construction of the Mishkan. His intention when gathering the wood was only to show the Jewish people what the punishment was for violating Shabbos which is utterly dissimilar to the usual objective of gathering wood, which is to make use of the wood that is gathered. He therefore did not actually commit a sin at all!
Let us examine a famous question regarding Melacha She’eina Tzricha le’Gufa, that is extremely relevant to medical practitioners.
Numerous patients require the placement of vascular catheters to provide them with intravenous medications or fluids. When inserting it, some blood is drawn and confirms that the catheter is in the vein and that the fluids and medications will flow.
Drawing blood on Shabbos is usually an Issur d’Oraysa. According to the Rambam (Shabbos 8:7) it is included in the Melacha of Dishah – threshing, which includes “Mefareik” – extracting liquids from their source. According to Rashi and Tosfos (Shabbos 107a) drawing blood violates the Melacha of “Netilas Neshama” – “taking of the soul” because every bit of blood contains the soul of a person.
Drawing blood for laboratory tests on Shabbos therefore violates an Issur d’Oraysa, and is only permitted in cases of danger to life (or via a non-Jew). According to Rav Yechezkel Abramsky zt”l and the Chazon Ish, the same is true of drawing blood when inserting an intravenous catheter – it too is an Issur d’Oraysa. However, Rav Shlomo Zalman Auerbach zt”l brought the following proof that it would only be an Issur Derabanan:
A woman may not pump her breast milk on Shabbos because of the Melacha of Dishah. However, she may certainly nurse her baby on Shabbos. The Shulchan Aruch (O.C. 328:39) rules that she may even squeeze some of her milk into her baby’s mouth to encourage it to latch on and nurse.
The Rema adds that it is nevertheless forbidden for her to do so to help a person who has been taken over by a Ruach Ra’ah (an evil spirit). Since his life is not in danger, there are no grounds for performing the Melacha of Mefareik on his behalf. However, the Magen Avraham (ad. loc.) argues that if he was in great distress (“Tza’ar Gadol”) it would be permitted (at least on a d’Oraysa level), as it is only a Melacha She’eina Tzricha le’Gufa. The Pri Megadim (Aishel Avraham 41) contends that according to the Magen Avraham it would similarly be permitted for a woman to squeeze some milk onto the floor in order to encourage the baby to feed, as that too would be no more than a Melacha She’eina Tzricha le’Gufa.
Rav Shlomo Zalman deduces from the Magen Avraham and Pri Megadim that whenever the Melacha of Mefareik is done for any purpose other than in order to make use of the extracted liquid in the conventional manner, it would be considered a Melacha She’eina Tzricha le’Gufa. Similarly, drawing blood when inserting an IV should also be considered a Melacha She’eina Tzricha le’Gufa as the blood will be discarded (or may flow back into the vein).
A similar discussion of Melacha She’eina Tzricha le’Gufa exists regarding “Dam Besulim” – “the blood (membrane) of virginity”. In former times, if a man wanted to be certain that his wife was a virgin at the time of their marriage (and therefore deserving of a Kesuba of 200 Zuz), he needed to examine whether her hymen (Besulim) had ruptured and bled the first time they engaged in intercourse.
The Gemara discusses whether a newly married husband and wife may first engage in intercourse on Shabbos, as breaking the Besulim may violate various Melachos of Shabbos. It is clear from the Gemara that the bleeding from the Besulim that is caused by intercourse is not considered a Melacha She’eina Tzricha le’Gufa, even though the blood will be discarded and the husband’s intention is ostensibly not to cause the bleeding!
According to Rav Shlomo Zalman this poses a problem. If drawing blood when inserting an IV is considered a Melacha She’eina Tzricha le’Gufa because the blood is thrown away and not used in a conventional manner, the same should surely apply to Dam Besulim?
Rav Shlomo Zalman answered that, in fact, the extraction of Dam Besulim does serve a purpose. Following intercourse, the husband would need to collect some of the blood to confirm that it was indeed Dam Besulim and not other blood that his wife had cunningly placed on the bed sheets to make it appear that she was a virgin. Since some of the Dam Besulim was needed, drawing it is in fact a Melacha She’Tzricha le’Gufa even though it will ultimately all be discarded.
Why can’t the same argument be made regarding the blood drawn during IV placement? There too, the blood temporarily serves an important purpose to confirm that the catheter is in a vein. The fact that it will ultimately be discarded shouldn’t render the act as a Melacha She’eina Tzricha le’Gufa!
Rav Shlomo Zalman explains that the main purpose of Dam Besulim is to prove that a woman was indeed a virgin. Therefore, the intercourse that causes the bleeding will always be considered a Melacha She’Tzricha le’Gufa as the blood itself has a purpose and is needed. However, when it comes to any other blood (or fluid – e.g. breastmilk) unless there really is a need for it (and it will not be discarded), the act will be considered a Melacha She’eina Tzricha le’Gufa.
To summarize: When drawing blood from the body on Shabbos, if the blood will be discarded (and not used for a purpose such as laboratory testing) it will usually be considered a Melacha She’eina Tzricha le’Gufa. However, if one is drawing the blood in order to use it in an archetypal manner (as is the case with Dam Besulim), it will not be considered a Melacha She’eina Tzricha le’Gufa even though it will ultimately be discarded.
It goes without saying that the above discussion is only relevant to a patient who is not in any danger. If a patient is in danger, inserting an IV is of course not only permitted but it is imperative, unless there is another equivalent method to administer the medication that will not violate Shabbos or cause any delay (e.g. subcutaneous or intramuscular injection).
 This is an example of the rule of “Megalgelin Chova Al Yeday Chayav” – we bring about punishment, through somebody who is guilty – i.e. the punishment for a person who violates Shabbos was taught through the vehicle of somebody who actually violated Shabbos.
 Maharsh”a deduces this from the words of the daughters of Tzelafchad who later described their father’s death with the words “b’Cheto Meis” – “by his sin, he died”. The Maharsh”a contends that this means that “he only sinned so that he would die” – i.e. to thereby display to others which death would be forthcoming for those who violate the laws of Shabbos.
 There is a dispute among the Tannaim as to whether one is liable for a Melacha She’eina Tzricha le’Gufa or not. The classic example of Melacha She’eina Tzricha le’Gufa is a person who digs a hole in order to make use of the dirt he removes. The usual objective of digging is to use the hole.
 If so, why was he put to death at all? The Maharsh”a explains that since his intentions were unclear to those who witnessed his sin, and they warned him not to do it, the law was that he was liable. His intentions were only “Devarim she’be’Leiv” (matters in his heart) which have no Halachic bearing. Fundamentally though, he did not actually sin. (Though the Gemara does seem to imply that he did– see footnote 1).
 Cited in Shemiras Shabbos Kehilchasa (Chap. 32, footnote 158).
 As testified by Dr. Falk Schlesinger (the second director of Shaarei Tzedek Hospital in Jerusalem and Talmid of the Chazon Ish) and cited by Shemiras Shabbos Kehilchasa (ibid.).
 Mishna Berura ad. loc.
 Such as “Chovel” (causing a wound) or even “Boneh”.
 Such as “Dam Tzipor” – the blood of a bird.