Snape can Occlude Voldemort as perhaps no other person can. This enables him to spy on Voldemort for the Order. When Voldemort scans Snape’s thoughts, he cannot see that Snape is working against him because Snape is able to defend certain thoughts from Voldemort’s view. But if Voldemort looks at Snape through Harry’s eyes, he will be able to see those things. Snape let Harry see past his defenses. By viewing one of Snape’s off-limits memories, Harry has just endangered them all and exposed Snape to mortal risk.

