You made up a prohibition on voyeurism, now make up that David is a “friend” of Uriah. Here’s fact: Uriah is a Hittite- the evil tribe that God had many times told Israel to exterminate. From Richard Bauckham’s Gospel Women:
Not only Canaanites but also Hittites were among the seven peoples of the land of Canaan whom God had promised to drive out and Israel had been commanded to annihilate (Exod 23:23, 28; 33:2; 34:11; Deut 7:1; 20:17; Josh 3:10; 1 Kgs 9:20–21; Ezra 9:1). Israel should not have intermarried with them (Deut 7:3–4; Judg 3:5–6; Ezra 9:1). They were the most abhorrent o f idolatrous Gentiles, polluting the holy land with their idolatry and evil.
But for you, they’re a “friend”? Bathsheba was a Jew and should not have been married to Uriah. In the narrative, God is terminating the evil. But no censure is made against David looking at Bathsheba, who is, like him, “beautiful.”