This is the distinction between antagonist and villain. Though even villains can have noble sentiments or goals that don't oblige them to be hostile dicks.