i think it’s the new “have a nice day” Most people don’t mean it- they just feel like they have to say something.
What prompts me to say "Thank you for your service" is seeing a vet wearing the baseball cap that identifies them as a veteran. I would think that if they don't want to be thanked for their service, they wouldn't be wearing the cap.