Is it a sin for a man to watch a naked woman?
In 2 Shmuel 11:2 David watched a naked woman, was that a sin?
There are 3 types of looking for our purposes1:
The answer to your question is, yes, one is not allowed to even glance (3) at the normally-covered parts of a woman's body (which is the halachic definition of "erva"/"nakedness", and includes also the hair of a married/widowed/divorced woman), even if one isn't trying to derive enjoyment from the glance2.
If the looking is "gazing" (1 or 2) i.e. deliberate watching/staring, and the woman is forbidden to him, then it is forbidden even if she is appropriately dressed (if he knows her, then even if one isn't looking at her, but just looking at her clothes!)3.
With regards to all of this, known as "shemirat enayim" (guarding one's eyes), the consensus is it is d'oraita4. See the Sefer HaMitzvot Negative Mitzvah 475. All the more so if she is inappropriately dressed.
It is based off of Bamidbar 15:39:
ולא תתורו אחרי לבבכם ואחרי עיניכם אשר אתם זונים אחריהם
Do not follow your heart and eyes after which you are going astray.
Rambam says in Hilchot Teshuva 4:4:
Someone who looks at forbidden women will think that there is no problem, since he will say: “Did I have intercourse or draw close to her?” But he does not know that looking is a great sin.
Tractate Soferim 9:10 and others (e.g. Or HaChaim on Vayikra 18:2, 11, Rashi on Tehillim 17:3, 2) hold it against David.
Sanhedrin 107a describes it as a deliberate test, and David saw her by accident (Satan tricked him). The sin came as a result.
Malbim blames him - once he accidentally saw, he didn't look away from the evil, however Malbim writes much to defend David overall in Shmuel Bet 11, against Abarbanel on the same.
There are commentaries that discuss also how David didn't really sin with Bat Sheva, at least not in the way that is commonly understood10. We don't like to venerate adulterers, so many feel the need to find a deeper more Divine message in the story of David and Bat Sheva.
There is a concept whereby holiness must be concealed in order that we should have free will11. God is recreating the whole world every instant, and at the very time He is creating me, I am able to not see Him and one might even deny Him (chas veshalom). In Kabbalah and Chassidus, the claim is made that the most holy needs to be the most concealed (see shiur quoted below, I can look up ma'amarim on this if anyone is interested); in order to conceal a lamp, one needs nothing but a piece of thick paper, but in order to conceal the sun, one has to build a building. When something is so holy that it would take away our free will in an instant, it must be buried in the darkest of places.
This concept is applied to anything related to the development and process of the coming of Moshiach, a very great light. David HaMelech, and Shlomo HaMelech are the grandfathers of Moshiach, and thus the birth of Shlomo was concealed by a great darkness - the apparent adultery of his father (see also story of Yehuda and Tamar, Ruth etc).
These facts are less commonly known about the story:
So this is not technically a sin. However David cried for the rest of his life asking for forgiveness for the way things look, which he regretted - the birth of his son through which Moshiach would come was buried under the ugliest of darkness, so the Godliness of what was going on should go unnoticed.
So what's really going on here? Bat Sheva was destined for David from the day the world was created13, even Uriah knew this14. David knew who she was15, and through through Ruach Hakodesh16 knew the Moshiach would come with his union with her. This combination of factors, including the explanations17 that David's subsequent passion after seeing her were not his fault - he had no Yeitzer Hara at this point - lead to us being don lechaf zechut that David didn't sin, although no doubt it certainly looks like he did, for the sake of distraction and confusion, for the reasons mentioned above (and more, see the quoted Malbim for many other facets).
To echo Rav Neventzal's closing line16, "in the merit of our seeing others in a favourable light, may Hashem judge us in a favourable light."
1 - Following Lift Up Your Eyes - R' S. Wagshal
2 - במ״ב סי׳ ע״ה ס״ק ז. See footnote 7 pp. 17 of Lift Up Your Eyes for full explanation and discussion.
3 - See Sefer Chareidim 2:4, Shulchan Aruch Even HaEzer 21:1. Be'er Hetev there brings Rabbeinu Yonah citing this is d'oraita, and Rambam as an example saying it is d'rabbanan. Note Rambam and others apparently derive it from Ketubot 46a, and Devarim 23:10 וְּנִשְׁמַרְתָּ מִכֹּל דָּבָר רָע. See Issurei Beiah 21:21
4 - Ritva and a few others hold it is d'rabbanan. Either way it is completely forbidden.
5 - Also, there are additional laws about not reciting berachot and studying Torah in front of nudity, even if one isn't looking (but is facing the nudity), which are completely off topic here but be aware they exist and look them up!
6 - See Shach on SH Y'D 195 s'k 20
7 - See footnote 13 of pp.22 in Lift Up Your Eyes for full discussion and explanation.
8 - SH E'H 21:3
9 - SH Y'D 195:7
10 - Rabbi Shmuel bar Naḥmani in the name of Rabbi Yonatan; Rebbi - Shabbat 56a
11 - See Likutei Halachot, Birkat Hodaah 4:45
12 - Ketuvot 9b, Tosafot there)
13 - Sanhedrin 107a
14 - Zohar
15 - Radak Shmuel Bet 11:3
16 - Rav Neventzal's sichot Bereshit, sichah 36, quoted here.
17 - Avoda Zara 4b-5a
Yes, it is, we can't get away from it.
However, if you look at a broader context, you will realize that in the Biblical narrative, prohibited sexual relations are frequently considered a measure to "save the world" especially for the Davidic (Messianic) line, for example:
So traditionally, the Jewish Messianic line seemingly purposefully relies on all kinds of Unkosher relations. While it IS considered a sin for laymen, for the leaders of the nation it is a deep understanding of genuine divine will camouflaged as a sin.
I don't believe it's inherently sinful to watch a naked woman. But I am drawing a distinct difference between sin and forbidden by halakhah. Halakha forbids a man from even walking by the door of a prostitute or a promiscuous woman, but if he did walk by I doubt God would mark that as a sin against him. But walking past the door is halakhically forbidden because it's so easy for a sin to arise that it's best to avoid the situation. The same applies with seeing a naked man or woman.
Adam and Eve saw each other naked in the beginning, and there was no sin mentioned. In fact God seems more concerned about Adam and Eve being concerned than about them being naked. But once sin and potentially lust entered the narrative, things changed. Adam and Eve were embarassed from their nakedness, and this embarassment is inherently linked to nudity and sin later. There's also the concept of desire which is separate from nudity. Consider that some people can lust after a woman who has nearly her entire body covered.
" If one gazes even at the little finger of a woman with the intent to have pleasure from it, it is as though he gazed at her shameful place." Source: Shulchan Aruch/Even ha-Ezer/21
Most of us can look at a woman's pinky without lusting after her, so most of us don't sin by looking at a woman's hand to look at her ring for example. But when it comes to naked bodies most of us are only capable at looking at our direct family members or children without lust and even then some people struggle. And then there's the concept of embarassment, once someone becomes aware of their nakedness it can become improper to see them naked afterward. What was once not a sin becomes so close to sin that we need to separate from it.
"A father is permitted to hug his daughter, kiss her, and sleep next to her [naked] with flesh touching, and so too a mother with her son, as long as they are minors....If the daughter is embarrassed to stand before her father naked, or she is betrothed, and likewise if the mother is embarrassed to stand before her son naked – even if they are minors, when they reach the point of being embarrassed, they may not sleep together except clothed." Source: ibid
But even if it may not be inherently sinful to look at someone who is naked, one must realize that almost all of us will sin when seeing someone naked. Recall that our king Dawid was far from sin most of his life, but one day he saw a naked woman and he could/would not stop himself from doing many sins. First he saw her, then he inquired of her, then he ignored the fact that she was married, then he had her brought to him by royal guards, then he impregnated her, then he killed her husband to hide the fact that he impregnated her. If he wouldn't have seen her naked, I doubt that the sins that followed would have happened.
Conclusion: Just like looking at a pinky finger may not inherently be sinful, looking at a naked women may not be inherently sinful. But don't let that distract you from the reality that even the greatest of us when seeing a naked women or a naked person of the opposite gender will immediately have sinful thoughts or be emboldened to do even worse sins such as the case with Dawid after seeing Bathsheba naked. Therefore it is halakhically forbidden to look at a naked woman and one should refrain from doing so.