It's one of many things associated with Aspergers. There are however a lot of ex career military people who are inflexible and repetitive in their ways. Then you have creatures of habit and sticklers.
People with autism often have very disorganized minds. They are "absentminded" and "scatterbrained". Many have ADHD. Therefore people with autism adhere to routines as a compensator to create structure and maintain order. Without it a person with autism might forget to: pay bills, go to work, go grocery shopping, brush teeth, remember to put pants on before leaving, etc.
Being without structured routines is like piloting an airplane at night without instruments for *some* people with autism.
So, it's not a matter of people with autism being inflexible in a repetitive way.
But *why* they are inflexible in a repetitive way.