In the Mishnah (20a) Rabbi Yehoshua mentions a number of people who he categorizes as mevalei olam – those whose actions destroy the world.
One of them is a hasid shoteh – a “foolish righteous person.”
Our Gemara defines the term by giving the example of a man who sees a woman drowning and reacts by saying that, as a religious person, it is inappropriate for him to look at her – even though that is the only way to save her.
In his Minhah Harevah, Rav Pinhas Epstein asks why this person is considered a hasid shoteh; by allowing this woman to drown, he has transgressed the prohibition of lo ta’amod al dam re’ekhah (“do not stand idly by the blood of your neighbor” – see Vayikra 19:16) and should be considered an evildoer.
One possible answer is that there are other people in the vicinity who can step forward and save her, and he is considered a hasid shoteh since he does not hurry to fulfill this important mitzvah because of skewed priorities.
The definition of a hasid shoteh as offered by the Rambam is not only someone who refrains from performing mitzvot because of what he believes to be religious stringencies, but also someone who is overly concerned with stringencies in general (the example given by the Me’iri is someone who fasts on a daily basis).
The Talmud Yerushalmi offers other examples to illustrate this concept, including someone who sees a child drowning and decides that he must remove his tefillin before jumping into the water to save him, someone who sees a potential rapist chasing after a young woman and is unwilling to strike out at the person, or even someone who sees a choice fruit on his tree and hurries to give it to charity without first making sure that the basic terumot and ma’asrot (tithes) have been taken properly.
–Rabbi Adin Steinsaltz