If the only reason you can give someone for doing something is "I'm just doing my job", then you may want to rethink why you're doing that job.

Civilian- "Why are you pointing that rifle at my face?!"

Officer-"I'm just doing my job, sir"

Compared to:

Civilian-"Why are you pointing that rifle at my face?"

Officer-"Sir, there's a dangerous criminal on the loose and we have to take all necessary precautions. We don't know if he's hiding in your car and has you at gun point so we have to act as if he's in every car. We'll move swiftly so you can be on your way."

Scenario 2 explains why he's doing what he's doing and can show reason to why he's doing it. If the only answer you can give is "Im just doing my job" then you're probably being a chode.