Why does を show the nuance of the speaker being prejudiced in this ?
The window was opened by Tanaka
Tanaka opened the window [and now I am annoyed]
Japanese Language Stack Exchange is a question and answer site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language. It only takes a minute to sign up.Sign up to join this community
The way I read this, 田中さんに is the key part when combined with 〜られた. When you say だれかさんにこうされた this implies that somebody (だれかさん) did this (こう) to you ( された). The implication being that the thing which was done to you is not something that you liked.
If you just said, 田中さんが窓を開けた that would normally be understood as a simple statement of fact. Tanaka opened the window. Okay, no problem (depending on the context).
But if you change the context... let's say that you are sitting in an air-conditioned room on a hot day, and Tanaka complains that it's too cold in the room. He wants to open the window to make things warmer... you tell him not to... you bicker about it for a while and he appears to comply. But then five minutes later he gets up and opens the window anyway. You give him a glare of annoyance but just accept it.
Later, someone else walks into the room and remarks on how warm it is in here, and why do you guys have the window open while the air-conditioner is running? You turn to him and reply with annoyance, 田中さんに窓を開けられた.
You could also have said 田中さんが窓を開けた, and the implication (considering the context of the situation and the tone of your voice) would still communicate your annoyance and the accusation at Tanaka. But the use of に adds a bit more of an accusatory nuance, implying that opening the window is something Tanaka did to you, as if it were an offense that he committed upon you personally.
Context is important when conveying nuance, but sometimes you can change the parts of sentence to make that nuance more explicit. Like in this case, using に窓を開けられた instead of が窓を開けた.