Some students see the instructor/teacher/lecturer as their ally. Someone whose role is to help them learn and understand.
Other students see the teacher as their adversary. Someone who is assessing them, critiquing them, making them feel dumb, forcing them to work, ... Someone they have to do battle with to get the marks and grade they think they deserve...
I am not sure how to get students to see me as their ally rather than their adversary. I think a lot of it boils down to my attitude and their attitude. I can change my attitude but there are some students whose attitude may not change, regardless of what I do. Also, the attitude of a class can be swayed, for better or for worse, by a few influential students. I think using a formative/summative assessment mix can help. This enables students to get feedback in a less threatening way and with lower stakes.
I welcome other ideas.