I work for a major law enforcement agency in California. I work patrol and due to our call load, I don’t do much traffic enforcement. However I know guys that work traffic divisions that will always write a ticket on a traffic stop. The thought is that you are treating everyone equally and when the inevitable biased policing complaint comes around (eg. you only stopped me and wrote me a ticket because x,y,z), you can show that you are consistent and not treating any particular group of people differently.
Not to mention that at least where I work, every traffic stop has been recorded either by in car video or body worn video for the past 20 years. When people hand over stuff like military IDs, police IDs, city employee IDs, or any other type of ID with hopes of persuading the officer to give them a break, it puts that officer in a bad position. Internal affairs regularly audits video of traffic stops. If there is any impression that you may be giving breaks to someone based on their government affiliation etc, you can stand by... For a lot of guys, it’s not worth risking their career for something like that.